Class GameRules

java.lang.Object
net.minecraft.src.GameRules

public class GameRules extends Object
  • Field Details

  • Constructor Details

    • GameRules

      public GameRules()
  • Method Details

    • addGameRule

      public void addGameRule(String par1Str, String par2Str)
      Define a game rule and its default value.
    • setOrCreateGameRule

      public void setOrCreateGameRule(String par1Str, String par2Str)
    • getGameRuleStringValue

      public String getGameRuleStringValue(String par1Str)
      Gets the string Game Rule value.
    • getGameRuleBooleanValue

      public boolean getGameRuleBooleanValue(String par1Str)
      Gets the boolean Game Rule value.
    • getGameRuleIntValue

      public int getGameRuleIntValue(String string)
      Gets the integer Game Rule value. returns 0 if no valid integer value was set
    • writeGameRulesToNBT

      public NBTTagCompound writeGameRulesToNBT()
      Return the defined game rules as NBT.
    • readGameRulesFromNBT

      public void readGameRulesFromNBT(NBTTagCompound par1NBTTagCompound)
      Set defined game rules from NBT.
    • getRules

      public String[] getRules()
      Return the defined game rules.
    • hasRule

      public boolean hasRule(String par1Str)
      Return whether the specified game rule is defined.