net.minecraft.world.rule

public class GameRules

net.minecraft.world.level.gamerules.GameRules
net.minecraft.class_1928
net.minecraft.world.rule.GameRules

Field summary

Modifier and TypeField
public static final GameRule<Boolean>
ADVANCE_TIME
field_19396
ADVANCE_TIME
public static final GameRule<Boolean>
ADVANCE_WEATHER
field_19406
ADVANCE_WEATHER
public static final GameRule<Boolean>
ALLOW_ENTERING_NETHER_USING_PORTALS
field_62435
ALLOW_ENTERING_NETHER_USING_PORTALS
public static final GameRule<Boolean>
BLOCK_DROPS
field_19392
DO_TILE_DROPS
public static final GameRule<Boolean>
BLOCK_EXPLOSION_DROP_DECAY
field_40880
BLOCK_EXPLOSION_DROP_DECAY
public static final GameRule<Boolean>
COMMAND_BLOCKS_WORK
field_62916
COMMAND_BLOCKS_WORK
public static final GameRule<Boolean>
COMMAND_BLOCK_OUTPUT
field_19394
COMMAND_BLOCK_OUTPUT
public static final GameRule<Boolean>
DROWNING_DAMAGE
field_20634
DROWNING_DAMAGE
public static final GameRule<Boolean>
ELYTRA_MOVEMENT_CHECK
field_19404
ELYTRA_MOVEMENT_CHECK
public static final GameRule<Boolean>
ENDER_PEARLS_VANISH_ON_DEATH
field_46176
ENDER_PEARLS_VANISH_ON_DEATH
public static final GameRule<Boolean>
ENTITY_DROPS
field_19393
ENTITY_DROPS
public static final GameRule<Boolean>
FALL_DAMAGE
field_20635
FALL_DAMAGE
public static final GameRule<Boolean>
FIRE_DAMAGE
field_20636
FIRE_DAMAGE
public static final GameRule<Integer>
FIRE_SPREAD_RADIUS_AROUND_PLAYER
field_56559
FIRE_SPREAD_RADIUS_AROUND_PLAYER
public static final GameRule<Boolean>
FORGIVE_DEAD_PLAYERS
field_25401
FORGIVE_DEAD_PLAYERS
public static final GameRule<Boolean>
FREEZE_DAMAGE
field_28044
FREEZE_DAMAGE
public static final GameRule<Boolean>
GLOBAL_SOUND_EVENTS
field_40886
GLOBAL_SOUND_EVENTS
public static final GameRule<Boolean>
IMMEDIATE_RESPAWN
field_20638
DO_IMMEDIATE_RESPAWN
public static final GameRule<Boolean>
KEEP_INVENTORY
field_19389
KEEP_INVENTORY
public static final GameRule<Boolean>
LAVA_SOURCE_CONVERSION
field_40885
LAVA_SOURCE_CONVERSION
public static final GameRule<Boolean>
LIMITED_CRAFTING
field_19407
LIMITED_CRAFTING
public static final GameRule<Boolean>
LOCATOR_BAR
field_59751
LOCATOR_BAR
public static final GameRule<Boolean>
LOG_ADMIN_COMMANDS
field_19397
LOG_ADMIN_COMMANDS
public static final GameRule<Integer>
MAX_BLOCK_MODIFICATIONS
field_41766
MAX_BLOCK_MODIFICATIONS
public static final GameRule<Integer>
MAX_COMMAND_FORKS
field_46658
MAX_COMMAND_FORKS
public static final GameRule<Integer>
MAX_COMMAND_SEQUENCE_LENGTH
field_19408
MAX_COMMAND_SEQUENCE_LENGTH
public static final GameRule<Integer>
MAX_ENTITY_CRAMMING
field_19405
MAX_ENTITY_CRAMMING
public static final GameRule<Integer>
MAX_MINECART_SPEED
field_52614
MAX_MINECART_SPEED
public static final GameRule<Integer>
MAX_SNOW_ACCUMULATION_HEIGHT
field_40883
MAX_SNOW_ACCUMULATION_HEIGHT
public static final GameRule<Boolean>
MOB_DROPS
field_19391
DO_MOB_LOOT
public static final GameRule<Boolean>
MOB_EXPLOSION_DROP_DECAY
field_40881
MOB_EXPLOSION_DROP_DECAY
public static final GameRule<Boolean>
MOB_GRIEFING
field_19388
DO_MOB_GRIEFING
public static final GameRule<Boolean>
NATURAL_HEALTH_REGENERATION
field_19395
NATURAL_HEALTH_REGENERATION
public static final GameRule<Boolean>
PLAYER_MOVEMENT_CHECK
field_54909
PLAYER_MOVEMENT_CHECK
public static final GameRule<Integer>
PLAYERS_NETHER_PORTAL_CREATIVE_DELAY
field_46795
PLAYERS_NETHER_PORTAL_CREATIVE_DELAY
public static final GameRule<Integer>
PLAYERS_NETHER_PORTAL_DEFAULT_DELAY
field_46794
PLAYERS_NETHER_PORTAL_DEFAULT_DELAY
public static final GameRule<Integer>
PLAYERS_SLEEPING_PERCENTAGE
field_28357
PLAYERS_SLEEPING_PERCENTAGE
public static final GameRule<Boolean>
PROJECTILES_CAN_BREAK_BLOCKS
field_46796
PROJECTILES_CAN_BREAK_BLOCKS
public static final GameRule<Boolean>
PVP
field_62434
PVP
public static final GameRule<Boolean>
RAIDS
field_19422
DISABLE_RAIDS
public static final GameRule<Integer>
RANDOM_TICK_SPEED
field_19399
RANDOM_TICK_SPEED
public static final GameRule<Boolean>
REDUCED_DEBUG_INFO
field_19401
REDUCED_DEBUG_INFO
public static final GameRule<Integer>
RESPAWN_RADIUS
field_19403
RESPAWN_RADIUS
public static final GameRule<Boolean>
SEND_COMMAND_FEEDBACK
field_19400
SEND_COMMAND_FEEDBACK
public static final GameRule<Boolean>
SHOW_ADVANCEMENT_MESSAGES
field_19409
ANNOUNCE_ADVANCEMENTS
public static final GameRule<Boolean>
SHOW_DEATH_MESSAGES
field_19398
SHOW_DEATH_MESSAGES
public static final GameRule<Boolean>
SPAWNER_BLOCKS_WORK
field_62917
SPAWNER_BLOCKS_WORK
public static final GameRule<Boolean>
SPAWN_MOBS
field_19390
DO_MOB_SPAWNING
public static final GameRule<Boolean>
SPAWN_MONSTERS
field_62436
SPAWN_MONSTERS
public static final GameRule<Boolean>
SPAWN_PATROLS
field_21831
SPAWN_PATROLS
public static final GameRule<Boolean>
SPAWN_PHANTOMS
field_20637
SPAWN_PHANTOMS
public static final GameRule<Boolean>
SPAWN_WANDERING_TRADERS
field_21832
SPAWN_WANDERING_TRADERS
public static final GameRule<Boolean>
SPAWN_WARDENS
field_38975
SPAWN_WARDENS
public static final GameRule<Boolean>
SPECTATORS_GENERATE_CHUNKS
field_19402
SPECTATORS_GENERATE_CHUNKS
public static final GameRule<Boolean>
SPREAD_VINES
field_42474
SPREAD_VINES
public static final GameRule<Boolean>
TNT_EXPLODES
field_58052
TNT_EXPLODES
public static final GameRule<Boolean>
TNT_EXPLOSION_DROP_DECAY
field_40882
TNT_EXPLOSION_DROP_DECAY
public static final GameRule<Boolean>
UNIVERSAL_ANGER
field_25402
UNIVERSAL_ANGER
public static final GameRule<Boolean>
WATER_SOURCE_CONVERSION
field_40884
WATER_SOURCE_CONVERSION
private final ServerGameRules
rules
field_9196
rules

Constructor summary

ModifierConstructor
public (FeatureSet enabledFeatures, ServerGameRules rules)
public (FeatureSet enabledFeatures)

Method summary

Modifier and TypeMethod
public static com.mojang.serialization.Codec<GameRules>
codec(FeatureFlagSet enabledFeatures)
method_76182(class_7699 arg0)
createCodec(FeatureSet featureSet)
public Stream<GameRule<?>>
availableRules()
method_76181()
streamRules()
public <T> T
get(GameRule<T> gameRule)
method_76185(class_12279<T> arg0)
getValue(GameRule<T> rule)
public <T> void
set(GameRule<T> gameRule, T value, MinecraftServer server)
method_76186(class_12279<T> arg0, T arg1, MinecraftServer arg2)
setValue(GameRule<T> rule, T value, MinecraftServer server)
public GameRules
copy(FeatureFlagSet enabledFeatures)
method_27325(class_7699 arg0)
withEnabledFeatures(FeatureSet enabledFeatures)
public void
setAll(GameRules other, MinecraftServer server)
method_76192(class_1928 arg0, MinecraftServer arg1)
copyFrom(GameRules rules, MinecraftServer server)
public void
setAll(GameRuleMap gameRulesMap, MinecraftServer server)
method_76188(class_12280 arg0, MinecraftServer arg1)
copyFrom(ServerGameRules rules, MinecraftServer server)
private <T> void
setFromOther(GameRuleMap gameRulesMap, GameRule<T> gameRule, MinecraftServer server)
method_76187(class_12280 arg0, class_12279<T> arg1, MinecraftServer arg2)
copyFrom(ServerGameRules rules, GameRule<T> rule, MinecraftServer server)
public void
visitGameRuleTypes(GameRuleTypeVisitor visitor)
method_20744(class_4311 arg0)
accept(GameRuleVisitor visitor)
private static GameRule<Boolean>
registerBoolean(String id, GameRuleCategory category, boolean defaultValue)
method_76198(String arg0, class_5198 arg1, boolean arg2)
registerBooleanRule(String name, GameRuleCategory category, boolean defaultValue)
private static GameRule<Integer>
registerInteger(String id, GameRuleCategory category, int defaultValue, int min)
method_76195(String arg0, class_5198 arg1, int arg2, int arg3)
registerIntRule(String name, GameRuleCategory category, int defaultValue, int minValue)
private static GameRule<Integer>
registerInteger(String id, GameRuleCategory category, int defaultValue, int min, int max)
method_76196(String arg0, class_5198 arg1, int arg2, int arg3, int arg4)
registerIntRule(String name, GameRuleCategory category, int defaultValue, int minValue, int maxValue)
private static GameRule<Integer>
registerInteger(String id, GameRuleCategory category, int defaultValue, int min, int max, FeatureFlagSet requiredFeatures)
method_76197(String arg0, class_5198 arg1, int arg2, int arg3, int arg4, class_7699 arg5)
registerIntRule(String name, GameRuleCategory category, int defaultValue, int minValue, int maxValue, FeatureSet requiredFeatures)
private static <T> GameRule<T>
register(String id, GameRuleCategory category, GameRuleType typeHint, com.mojang.brigadier.arguments.ArgumentType<T> argumentType, com.mojang.serialization.Codec<T> codec, T defaultValue, FeatureFlagSet requiredFeatures, GameRules$VisitorCaller<T> visitorCaller, ToIntFunction<T> commandResultFunction)
method_8359(String arg0, class_5198 arg1, class_11845 arg2, com.mojang.brigadier.arguments.ArgumentType<T> arg3, com.mojang.serialization.Codec<T> arg4, T arg5, class_7699 arg6, class_1928$class_5199<T> arg7, ToIntFunction<T> arg8)
register(String name, GameRuleCategory category, GameRuleType type, com.mojang.brigadier.arguments.ArgumentType<T> argumentType, com.mojang.serialization.Codec<T> codec, T defaultValue, FeatureSet requiredFeatures, GameRules$Acceptor<T> acceptor, ToIntFunction<T> commandResultSupplier)
public static GameRule<?>
bootstrap(Registry<GameRule<?>> registry)
method_76199(class_2378<class_12279<?>> arg0)
registerAndGetDefault(Registry<GameRule<?>> registry)
public <T> String
getAsString(GameRule<T> gameRule)
method_76200(class_12279<T> arg0)
getRuleValueName(GameRule<T> rule)
private static int
lambda$registerInteger$5(Integer arg0)
method_76194(Integer arg0)
method_76194(Integer value)
private static int
lambda$registerBoolean$4(Boolean arg0)
method_76193(Boolean arg0)
method_76193(Boolean value)
private static void
lambda$visitGameRuleTypes$3(GameRuleTypeVisitor arg0, GameRule arg1)
method_76190(class_4311 arg0, class_12279 arg1)
method_76190(GameRuleVisitor arg0, GameRule rule)
private void
lambda$setAll$2(GameRuleMap arg0, MinecraftServer arg1, GameRule arg2)
method_76189(class_12280 arg0, MinecraftServer arg1, class_12279 arg2)
method_76189(ServerGameRules arg0, MinecraftServer arg1, GameRule rule)
private static ServerGameRules
lambda$codec$1(GameRules arg0)
method_76191(class_1928 arg0)
method_76191(GameRules arg0)
private static GameRules
lambda$codec$0(FeatureFlagSet arg0, GameRuleMap arg1)
method_76184(class_7699 arg0, class_12280 arg1)
method_76184(FeatureSet arg0, ServerGameRules rules)