Interface Vanilla


public interface Vanilla
A marker interface for DataComponents that have a direct counterpart in vanilla Minecraft.

Components implementing this interface are responsible for synchronizing their values directly with the NMS/Bukkit ItemStack data component system, ensuring that changes are reflected in the actual game client.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(org.bukkit.inventory.ItemStack stack)
    Applies the value of this component to the specified ItemStack.
    void
    remove(org.bukkit.inventory.ItemStack stack)
    Removes this specific vanilla component from the ItemStack.
  • Method Details

    • apply

      void apply(org.bukkit.inventory.ItemStack stack)
      Applies the value of this component to the specified ItemStack.

      This method typically calls ItemStack.setData(MaterialData) using the appropriate vanilla DataComponentType.

      Parameters:
      stack - The ItemStack to modify.
    • remove

      void remove(org.bukkit.inventory.ItemStack stack)
      Removes this specific vanilla component from the ItemStack.

      This effectively unsets the data on the stack, reverting it to its default state for that specific vanilla component type.

      Parameters:
      stack - The ItemStack to modify.