Class PowerItemComponent

java.lang.Object
valorless.rarespawns.builders.components.PowerItemComponent

public class PowerItemComponent extends Object
Configuration component describing how a Power Item behaves.

Holds flags and parameters controlling where and how a power item can be used (consumable behavior, allowed blocks/worlds, drop/ominous rules, per-use delay, permission, and optional sound cues). Unless stated otherwise, null means "use plugin defaults".

  • Constructor Details

    • PowerItemComponent

      public PowerItemComponent(PowerItemType type)
      Creates a new component for the given power item type.
      Parameters:
      type - the power item category this configuration applies to
  • Method Details

    • getType

      public PowerItemType getType()
      Gets the power item type this component represents.
      Returns:
      the power item type
    • getConsumable

      public Boolean getConsumable()
      Indicates whether the item is consumed on use.
      Returns:
      true if consumed; false if not; null to use default
    • setConsumable

      public void setConsumable(Boolean consumable)
      Sets whether the item is consumed on use.
      Parameters:
      consumable - true to consume; false to keep; null to use default
    • getBlocks

      public List<String> getBlocks()
      Gets the allow-list of blocks the item can interact with.
      Returns:
      string list of materials, or null to allow plugin default
    • setBlocks

      public void setBlocks(List<String> blocks)
      Sets the allow-list of blocks the item can interact with.
      Parameters:
      blocks - string list of materials; null for default behavior
    • getDrops

      public Boolean getDrops()
      Whether broken blocks should drop items when using this item.
      Returns:
      true to drop; false to suppress; null to use default
    • setDrops

      public void setDrops(Boolean drops)
      Sets whether broken blocks should drop items when using this item.
      Parameters:
      drops - true to drop; false to suppress; null to use default
    • getOminous

      public Boolean getOminous()
      Whether an "ominous" state is required for breaking/interaction to work.
      Returns:
      true if required; false if not; null to use default
    • setOminous

      public void setOminous(Boolean ominous)
      Sets whether an "ominous" state is required for breaking/interaction to work.
      Parameters:
      ominous - true if required; false if not; null to use default
    • getTrowelDelay

      public Integer getTrowelDelay()
      Gets the delay between uses (in milliseconds) for trowel interactions.
      Returns:
      delay in milliseconds; null to use default
    • setTrowelDelay

      public void setTrowelDelay(Integer trowelDelay)
      Sets the delay between uses (in milliseconds) for trowel interactions.
      Parameters:
      trowelDelay - delay in milliseconds; null for default
    • getTrowelDurabilityCost

      public Integer getTrowelDurabilityCost()
      Gets the durability cost per use for trowel interactions.
      Returns:
      durability cost; null to use default
    • setTrowelDurabilityCost

      public void setTrowelDurabilityCost(Integer trowelDurabilityCost)
      Sets the durability cost per use for trowel interactions.
      Parameters:
      trowelDurabilityCost - durability cost; null for default
    • getWorlds

      public List<String> getWorlds()
      Gets the allow-list of worlds where the item can be used.
      Returns:
      list of world names; null or empty may mean allowed everywhere
    • setWorlds

      public void setWorlds(List<String> worlds)
      Sets the allow-list of worlds where the item can be used.
      Parameters:
      worlds - world names; null/empty to allow in all worlds (unless configured otherwise)
    • getPermission

      public String getPermission()
      Gets the permission node required to use the item.
      Returns:
      permission string; null if no permission required
    • setPermission

      public void setPermission(String permission)
      Sets the permission node required to use the item.
      Parameters:
      permission - permission string; null if no permission required
    • getSound

      public Sound getSound()
      Gets the optional sound to play when this power item is activated.
      Returns:
      the configured sound, or null if none
    • setSound

      public void setSound(String sound)
      Sets the activation sound from a compact string definition.

      Expected formats follow Sound.parse(String) semantics, for example: "minecraft:entity.player.levelup:1.0:1.0" or "ENTITY_PLAYER_LEVELUP:0.8:1.2". Passing null clears the sound.

      Parameters:
      sound - the sound definition string; null to disable
    • setSound

      public void setSound(Sound sound)
      Sets the activation sound.

      Passing null clears the sound.

      Parameters:
      sound - the sound; null to disable