Class CustomGameRuleCategory
java.lang.Object
net.fabricmc.fabric.api.gamerule.v1.CustomGameRuleCategory
Utility class for creating custom game rule categories outside of the categories
Minecraft provides.-
Constructor Summary
ConstructorsConstructorDescriptionCustomGameRuleCategory(Identifier id, Text name) Creates a custom game rule category. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic <T extends GameRules.Rule<T>>
Optional<CustomGameRuleCategory>getCategory(GameRules.Key<T> key) Gets the custom category agame rule keyis registered to.getId()getName()inthashCode()
-
Constructor Details
-
CustomGameRuleCategory
Creates a custom game rule category.- Parameters:
id- the id of this categoryname- the name of this category
-
-
Method Details
-
getId
-
getName
-
equals
-
hashCode
public int hashCode() -
getCategory
public static <T extends GameRules.Rule<T>> Optional<CustomGameRuleCategory> getCategory(GameRules.Key<T> key) Gets the custom category agame rule keyis registered to.- Type Parameters:
T- the type of value the rule holds- Parameters:
key- the rule key- Returns:
- the custom category this rule belongs to. Otherwise
empty
-