Class AttributeManager

java.lang.Object
net.minestom.server.attribute.AttributeManager

public final class AttributeManager extends Object
  • Constructor Details

    • AttributeManager

      public AttributeManager()
  • Method Details

    • register

      public void register(Attribute attribute)
      Adds a new Attribute. This does NOT send the new list to players.
      Parameters:
      attribute - the attribute to add
    • loadVanillaAttributes

      public void loadVanillaAttributes()
    • removeBiome

      public void removeBiome(@NotNull @NotNull Attribute attribute)
      Removes a attribute. This does NOT send the new list to players.
      Parameters:
      attribute - the attribute to remove
    • unmodifiableCollection

      public Collection<Attribute> unmodifiableCollection()
      Returns an immutable copy of the attribute already registered.
      Returns:
      an immutable copy of the attributes already registered
    • getById

      @Nullable public @Nullable Attribute getById(int id)
      Gets a attribute by its id.
      Parameters:
      id - the id of the attribute
      Returns:
      the Attribute linked to this id
    • getByName

      @Nullable public @Nullable Attribute getByName(@NotNull @NotNull NamespaceID namespaceID)
    • getByName

      @Nullable public @Nullable Attribute getByName(@NotNull @NotNull String namespaceID)
    • getId

      public int getId(Attribute attribute)
      Gets the id of a attribute. `
      Parameters:
      attribute -
      Returns:
      the id of the attribute, or -1 if the attribute is not registered