Interface ConsumableComponent

All Superinterfaces:
ConfigurationSerializable

@Experimental public interface ConsumableComponent extends ConfigurationSerializable
Represents a component which item can be consumed on use.
  • Method Details

    • getConsumeSeconds

      float getConsumeSeconds()
      Gets the time in seconds it will take for this item to be consumed.
      Returns:
      consume time
    • setConsumeSeconds

      void setConsumeSeconds(float consumeSeconds)
      Sets the time in seconds it will take for this item to be consumed.
      Parameters:
      consumeSeconds - new consume time
    • getAnimation

      @NotNull ConsumableComponent.Animation getAnimation()
      Gets the animation used during consumption of the item.
      Returns:
      animation
    • setAnimation

      void setAnimation(@NotNull ConsumableComponent.Animation animation)
      Sets the animation used during consumption of the item.
      Parameters:
      animation - the new animation
    • getSound

      @Nullable Sound getSound()
      Gets the sound to play during and on completion of the item's consumption.
      Returns:
      the sound
    • setSound

      void setSound(@Nullable Sound sound)
      Sets the sound to play during and on completion of the item's consumption.
      Parameters:
      sound - sound or null for current default
    • hasConsumeParticles

      boolean hasConsumeParticles()
      Gets whether consumption particles are emitted while consuming this item.
      Returns:
      true for particles emitted while consuming, false otherwise
    • setConsumeParticles

      void setConsumeParticles(boolean consumeParticles)
      Sets whether consumption particles are emitted while consuming this item.
      Parameters:
      consumeParticles - if particles need to be emitted while consuming the item
    • getEffects

      @NotNull List<ConsumableEffect> getEffects()
      Gets the effects which may be applied by this item when consumed.
      Returns:
      consumable effects
    • setEffects

      void setEffects(@NotNull List<ConsumableEffect> effects)
      Sets the effects which may be applied by this item when consumed.
      Parameters:
      effects - new effects
    • addEffect

      @NotNull ConsumableEffect addEffect(@NotNull ConsumableEffect effect)
      Adds an effect which may be applied by this item when consumed.
      Parameters:
      effect - the effect
      Returns:
      the added effect