Package net.minestom.server.attribute
Class AttributeManager
java.lang.Object
net.minestom.server.attribute.AttributeManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Attribute
getById
(int id) Gets a attribute by its id.@Nullable Attribute
@Nullable Attribute
getByName
(@NotNull NamespaceID namespaceID) int
Gets the id of a attribute.void
void
Adds a new Attribute.void
removeBiome
(@NotNull Attribute attribute) Removes a attribute.Returns an immutable copy of the attribute already registered.
-
Constructor Details
-
AttributeManager
public AttributeManager()
-
-
Method Details
-
register
Adds a new Attribute. This does NOT send the new list to players.- Parameters:
attribute
- the attribute to add
-
loadVanillaAttributes
public void loadVanillaAttributes() -
removeBiome
Removes a attribute. This does NOT send the new list to players.- Parameters:
attribute
- the attribute to remove
-
unmodifiableCollection
Returns an immutable copy of the attribute already registered.- Returns:
- an immutable copy of the attributes already registered
-
getById
Gets a attribute by its id.- Parameters:
id
- the id of the attribute- Returns:
- the
Attribute
linked to this id
-
getByName
-
getByName
-
getId
Gets the id of a attribute. `- Parameters:
attribute
-- Returns:
- the id of the attribute, or -1 if the attribute is not registered
-