java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans.Talisman
All Implemented Interfaces:
Placeable
Direct Known Subclasses:
MagicianTalisman

public class Talisman extends SlimefunItem
  • Field Details

    • TALISMANS_ITEMGROUP

      protected static final ItemGroup TALISMANS_ITEMGROUP
    • suffix

      protected final String suffix
    • consumable

      protected final boolean consumable
    • cancel

      protected final boolean cancel
    • effects

      protected final PotionEffect[] effects
    • chance

      protected final int chance
  • Constructor Details

  • Method Details

    • isConsumable

      public boolean isConsumable()
      This returns whether the Talisman will be consumed upon use.
      Returns:
      Whether this Talisman is consumed on use.
    • getChance

      public int getChance()
      This returns the chance of this Talisman activating. The chance will be between 1 and 100.
      Returns:
      The chance of this Talisman activating.
    • getEffects

      @Nonnull public PotionEffect[] getEffects()
    • isEventCancelled

      protected boolean isEventCancelled()
    • postRegister

      public void postRegister()
      Description copied from class: SlimefunItem
      This method is called after SlimefunItem.register(SlimefunAddon). Override this method to add any additional setup that needs to happen after the original registration of this SlimefunItem.
      Overrides:
      postRegister in class SlimefunItem
    • load

      public void load()
      Description copied from class: SlimefunItem
      This method is used for internal purposes only.
      Overrides:
      load in class SlimefunItem
    • trigger

      @ParametersAreNonnullByDefault public static boolean trigger(Event e, SlimefunItemStack stack)
    • trigger

      @ParametersAreNonnullByDefault public static boolean trigger(Event e, SlimefunItemStack stack, boolean sendMessage)
    • trigger

      @ParametersAreNonnullByDefault public static boolean trigger(Event e, SlimefunItem item)
    • trigger

      @ParametersAreNonnullByDefault public static boolean trigger(Event e, SlimefunItem item, boolean sendMessage)
    • isSilent

      public boolean isSilent()
      This returns whether the Talisman is silent. A silent Talisman will not send a message to a Player when activated.
      Returns:
      Whether this Talisman is silent
    • getMessageSuffix

      @Nullable protected final String getMessageSuffix()
    • sendMessage

      public void sendMessage(@Nonnull Player p)
      This method sends the given Player the message of this Talisman. Dependent on the selected config setting, the message will be sent via the actionbar or in the chat window.
      Parameters:
      p - The Player who shall receive the message