Class CustomToolItem.Builder

java.lang.Object
com.github.imdabigboss.easydatapack.api.items.CustomItem.Builder
com.github.imdabigboss.easydatapack.api.items.CustomToolItem.Builder
Enclosing class:
CustomToolItem

public static class CustomToolItem.Builder extends CustomItem.Builder
This class represents a builder for a custom tool item.
  • Constructor Details

    • Builder

      public Builder(int customModelData, @NonNull String namespaceKey, @NonNull String name, @NonNull org.bukkit.Material baseMaterial, double attackDamage, double attackSpeed)
      Creates a new builder for a custom tool item.
      Parameters:
      customModelData - the custom model data of the item
      namespaceKey - the namespace key of the item
      name - the name of the item
      baseMaterial - the base material of the item
      attackDamage - the attack damage of the tool
      attackSpeed - the attack speed of the tool
  • Method Details

    • playerHitEntityEvent

      public @NonNull CustomToolItem.Builder playerHitEntityEvent(@Nullable @Nullable Consumer<org.bukkit.event.entity.EntityDamageByEntityEvent> playerHitEntityEvent)
      Sets the event that is called when a player hits an entity with the tool.
      Parameters:
      playerHitEntityEvent - the event that is called when a player hits an entity with the tool
      Returns:
      the builder
    • playerBreakBlockEvent

      public @NonNull CustomToolItem.Builder playerBreakBlockEvent(@Nullable @Nullable Consumer<org.bukkit.event.block.BlockBreakEvent> playerBreakBlockEvent)
      Sets the event that is called when a player breaks a block with the tool.
      Parameters:
      playerBreakBlockEvent - the event that is called when a player breaks a block with the tool
      Returns:
      the builder
    • build

      public @NonNull CustomToolItem build()
      Builds the custom tool item.
      Overrides:
      build in class CustomItem.Builder
      Returns:
      the custom tool item