Enum Class GameRule

java.lang.Object
java.lang.Enum<GameRule>
org.geysermc.geyser.level.GameRule
All Implemented Interfaces:
Serializable, Comparable<GameRule>, Constable

public enum GameRule extends Enum<GameRule>
This enum stores each gamerule along with the value type and the default. It is used to construct the list for the settings menu
  • Enum Constant Details

    • ANNOUNCEADVANCEMENTS

      public static final GameRule ANNOUNCEADVANCEMENTS
    • COMMANDBLOCKOUTPUT

      public static final GameRule COMMANDBLOCKOUTPUT
    • DISABLEELYTRAMOVEMENTCHECK

      public static final GameRule DISABLEELYTRAMOVEMENTCHECK
    • DISABLERAIDS

      public static final GameRule DISABLERAIDS
    • DODAYLIGHTCYCLE

      public static final GameRule DODAYLIGHTCYCLE
    • DOENTITYDROPS

      public static final GameRule DOENTITYDROPS
    • DOFIRETICK

      public static final GameRule DOFIRETICK
    • DOIMMEDIATERESPAWN

      public static final GameRule DOIMMEDIATERESPAWN
    • DOINSOMNIA

      public static final GameRule DOINSOMNIA
    • DOLIMITEDCRAFTING

      public static final GameRule DOLIMITEDCRAFTING
    • DOMOBLOOT

      public static final GameRule DOMOBLOOT
    • DOMOBSPAWNING

      public static final GameRule DOMOBSPAWNING
    • DOPATROLSPAWNING

      public static final GameRule DOPATROLSPAWNING
    • DOTILEDROPS

      public static final GameRule DOTILEDROPS
    • DOTRADERSPAWNING

      public static final GameRule DOTRADERSPAWNING
    • DOWEATHERCYCLE

      public static final GameRule DOWEATHERCYCLE
    • DROWNINGDAMAGE

      public static final GameRule DROWNINGDAMAGE
    • FALLDAMAGE

      public static final GameRule FALLDAMAGE
    • FIREDAMAGE

      public static final GameRule FIREDAMAGE
    • FREEZEDAMAGE

      public static final GameRule FREEZEDAMAGE
    • FORGIVEDEADPLAYERS

      public static final GameRule FORGIVEDEADPLAYERS
    • KEEPINVENTORY

      public static final GameRule KEEPINVENTORY
    • LOGADMINCOMMANDS

      public static final GameRule LOGADMINCOMMANDS
    • MAXCOMMANDCHAINLENGTH

      public static final GameRule MAXCOMMANDCHAINLENGTH
    • MAXENTITYCRAMMING

      public static final GameRule MAXENTITYCRAMMING
    • MOBGRIEFING

      public static final GameRule MOBGRIEFING
    • NATURALREGENERATION

      public static final GameRule NATURALREGENERATION
    • PLAYERSSLEEPINGPERCENTAGE

      public static final GameRule PLAYERSSLEEPINGPERCENTAGE
    • RANDOMTICKSPEED

      public static final GameRule RANDOMTICKSPEED
    • REDUCEDDEBUGINFO

      public static final GameRule REDUCEDDEBUGINFO
    • SENDCOMMANDFEEDBACK

      public static final GameRule SENDCOMMANDFEEDBACK
    • SHOWDEATHMESSAGES

      public static final GameRule SHOWDEATHMESSAGES
    • SPAWNRADIUS

      public static final GameRule SPAWNRADIUS
    • SPECTATORSGENERATECHUNKS

      public static final GameRule SPECTATORSGENERATECHUNKS
    • UNIVERSALANGER

      public static final GameRule UNIVERSALANGER
    • UNKNOWN

      public static final GameRule UNKNOWN
  • Field Details

    • VALUES

      public static final GameRule[] VALUES
  • Method Details

    • values

      public static GameRule[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GameRule valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • convertValue

      public Object convertValue(String value)
      Convert a string to an object of the correct type for the current gamerule
      Parameters:
      value - The string value to convert
      Returns:
      The converted and formatted value
    • fromJavaID

      public static GameRule fromJavaID(String id)
      Fetch a game rule by the given Java ID
      Parameters:
      id - The ID of the gamerule
      Returns:
      A GameRule object representing the requested ID or UNKNOWN
    • getJavaID

      public String getJavaID()
    • getType

      public Class<?> getType()
    • getDefaultValue

      public Object getDefaultValue()