Class ItemAbility

java.lang.Object
net.neoforged.neoforge.common.ItemAbility

public final class ItemAbility extends Object
  • Field Details

    • actions

      private static final Map<String,ItemAbility> actions
    • CODEC

      public static com.mojang.serialization.Codec<ItemAbility> CODEC
    • STREAM_CODEC

      public static net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,ItemAbility> STREAM_CODEC
    • name

      private final String name
  • Constructor Details

    • ItemAbility

      private ItemAbility(String name)
      Use get(String) to get or create a ItemAbility
  • Method Details

    • getActions

      public static Collection<ItemAbility> getActions()
      Returns all registered actions. This collection can be kept around, and will update itself in response to changes to the map. See ConcurrentHashMap.values() for details.
    • get

      public static ItemAbility get(String name)
      Gets or creates a new ItemAbility for the given name.
    • name

      public String name()
      Returns the name of this item ability
    • toString

      public String toString()
      Overrides:
      toString in class Object