createEnumRule

static GameRules.Type<EnumRule<E>> createEnumRule<E extends Enum<E>>(E defaultValue)

Creates an enum rule type.

All enum values are supported.

Return

an enum rule type

Parameters

defaultValue

the default value of the game rule

<E>

the type of enum this game rule stores

static GameRules.Type<EnumRule<E>> createEnumRule<E extends Enum<E>>(E defaultValue, BiConsumer<MinecraftServer, EnumRule<E>> changedCallback)

Creates an enum rule type.

All enum values are supported.

Return

an enum rule type

Parameters

defaultValue

the default value of the game rule

changedCallback

a callback that is invoked when the value of a game rule has changed

<E>

the type of enum this game rule stores

static GameRules.Type<EnumRule<E>> createEnumRule<E extends Enum<E>>(E defaultValue, Array<E> supportedValues)

Creates an enum rule type.

Return

an enum rule type

Parameters

defaultValue

the default value of the game rule

supportedValues

the values the game rule may support

<E>

the type of enum this game rule stores

static GameRules.Type<EnumRule<E>> createEnumRule<E extends Enum<E>>(E defaultValue, Array<E> supportedValues, BiConsumer<MinecraftServer, EnumRule<E>> changedCallback)

Creates an enum rule type.

Return

an enum rule type

Parameters

defaultValue

the default value of the game rule

supportedValues

the values the game rule may support

changedCallback

a callback that is invoked when the value of a game rule has changed.

<E>

the type of enum this game rule stores