register

static GameRules.Key<Tregister<T extends GameRules.Rule<T>>(String name, GameRules.Category category, GameRules.Type<T> type)

Registers a GameRules.Rule.

Return

a rule key which can be used to query the value of the rule

Parameters

name

the name of the rule

category

the category of this rule

type

the rule type

<T>

the type of rule

Throws

if a rule of the same name already exists

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.

Return

a rule key which can be used to query the value of the rule

Parameters

name

the name of the rule

category

the category of this rule

type

the rule type

<T>

the type of rule

Throws

if a rule of the same name already exists