public enum GameRule extends Enum<GameRule>
The default value for all game rules is true
except for REDUCED_DEBUG_INFO
and
KEEP_INVENTORY
, which are both false
by default
Modifier and Type | Class and Description |
---|---|
static class |
GameRule.Value
Represents a value which can be possessed by the game rule
|
Enum Constant and Description |
---|
COMMAND_BLOCK_OUTPUT
Whether command blocks should notify admins when they perform commands
|
DO_DAYLIGHT_CYCLE
Whether time progresses
|
DO_ENTITY_DROPS
Whether entities that are not mobs should have drops
|
DO_FIRE_TICK
Whether fire should spread and naturally extinguish
|
DO_MOB_LOOT
Whether mobs should drop items
|
DO_MOB_SPAWNING
Whether mobs should naturally spawn
|
DO_TILE_DROPS
Whether blocks should have drops
|
KEEP_INVENTORY
Whether the player should keep items in their inventory after death
|
LOG_ADMIN_COMMANDS
Whether to log admin commands to server log
|
MOB_GRIEFING
Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep,
and villagers should be able to change blocks and whether villagers, zombies, skeletons,
and zombie pigmen can pick up items
|
NATURAL_REGENERATION
Whether the player can regenerate health naturally if their hunger is full enough (doesn't affect external
healing, such as golden apples, the Regeneration effect, etc.)
|
RANDOM_TICK_SPEED
How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick.
|
REDUCED_DEBUG_INFO
Whether the debug screen shows all or reduced information
|
SEND_COMMAND_FEEDBACK
Whether the feedback from commands executed by a player should show up in chat.
|
SHOW_DEATH_MESSAGES
Whether a message appears in chat when a player dies
|
SPECTATORS_GENERATE_CHUNKS
Whether players in spectator mode can generate chunks
|
Modifier and Type | Method and Description |
---|---|
boolean |
boolEqualToValue(boolean b)
Checks if the argument matches the default value
|
GameRule.Value |
defaultValue()
Obtains the default value of the game rule
|
boolean |
intEqualToValue(int i)
Checks if the argument matches the default value
|
String |
toString() |
static GameRule |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static GameRule[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GameRule COMMAND_BLOCK_OUTPUT
public static final GameRule DO_DAYLIGHT_CYCLE
public static final GameRule DO_ENTITY_DROPS
public static final GameRule DO_FIRE_TICK
public static final GameRule DO_MOB_LOOT
public static final GameRule DO_MOB_SPAWNING
public static final GameRule DO_TILE_DROPS
public static final GameRule KEEP_INVENTORY
public static final GameRule LOG_ADMIN_COMMANDS
public static final GameRule MOB_GRIEFING
public static final GameRule NATURAL_REGENERATION
public static final GameRule RANDOM_TICK_SPEED
Default value: 3
0 will disable random ticks, higher numbers will increase random ticks
public static final GameRule REDUCED_DEBUG_INFO
public static final GameRule SEND_COMMAND_FEEDBACK
public static final GameRule SHOW_DEATH_MESSAGES
public static final GameRule SPECTATORS_GENERATE_CHUNKS
public static GameRule[] values()
for (GameRule c : GameRule.values()) System.out.println(c);
public static GameRule valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic GameRule.Value defaultValue()
public boolean boolEqualToValue(boolean b)
b
- the boolean to checktrue
if it matches, false
otherwisepublic boolean intEqualToValue(int i)
i
- the integer to checktrue
if it matches, false
otherwiseCopyright © 2016. All rights reserved.