GameRuleRegistry

public final class GameRuleRegistry

A utility class which allows for registration of game rules. Note game rules with duplicate keys are not allowed. Checking if a game rule key is already taken can be done using hasRegistration.

Creation of rule types is done using GameRuleFactory.

See also

Functions

hasRegistration
Link copied to clipboard
static boolean hasRegistration(String ruleName)
Checks if a name for a game rule is already registered.
register
Link copied to clipboard
static GameRules.Key<Tregister<T extends GameRules.Rule<T>>(String name, CustomGameRuleCategory category, GameRules.Type<T> type)
Registers a GameRules.Rule with a custom category.
static GameRules.Key<Tregister<T extends GameRules.Rule<T>>(String name, GameRules.Category category, GameRules.Type<T> type)
Registers a GameRules.Rule.

Sources

jvm source
Link copied to clipboard