GameRuleHelper - friendlyhj/ZenUtils GitHub Wiki
This allows you to create custom gamerules, and get the value of any existing gamerule.
mods.zenutils.GameRuleHelper
Get the instance from IWorld
using ZenGetter gameRuleHelper
, or method getGameRuleHelper
.
-
void addGameRule(String key, String value, String type) --- add gamerule with the given default value and type, type must be Any, Numeric or Boolean.
-
boolean hasRule(String name) --- check whether the given rule existed.
-
String[] getRules() --- get all the existing rules.
-
boolean getBoolean(String name) --- get the rule value as boolean type.
-
int getInt(String name) --- get the rule value as int type.
-
String getString(String name) --- get the rule value as string type.