Class Talisman
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final intprotected final booleanprotected final PotionEffect[]protected final Stringprotected static final ItemGroupFields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTalisman(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, String messageSuffix, int chance, PotionEffect... effects) Talisman(SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, String messageSuffix, int chance, PotionEffect... effects) Talisman(SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, String messageSuffix, PotionEffect... effects) Talisman(SlimefunItemStack item, ItemStack[] recipe, String messageSuffix, int chance, PotionEffect... effects) -
Method Summary
Modifier and TypeMethodDescriptionintThis returns the chance of thisTalismanactivating.protected final StringbooleanThis returns whether theTalismanwill be consumed upon use.protected booleanbooleanisSilent()This returns whether theTalismanis silent.voidload()This method is used for internal purposes only.voidThis method is called afterSlimefunItem.register(SlimefunAddon).voidstatic booleantrigger(Event e, SlimefunItem item) static booleantrigger(Event e, SlimefunItem item, boolean sendMessage) static booleantrigger(Event e, SlimefunItemStack stack) static booleantrigger(Event e, SlimefunItemStack stack, boolean sendMessage) Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, callItemHandler, canUse, equals, error, getAddon, getBlockTicker, getById, getByItem, getDrops, getDrops, getHandlers, getId, getItem, getItemGroup, getItemName, getItemSetting, getItemSettings, getOptionalById, getOptionalByItem, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, hashCode, hasResearch, info, isDisabled, isDisabledIn, isDisenchantable, isEnchantable, isHidden, isItem, isItemStackImmutable, isTicking, isUseableInWorkbench, preRegister, register, sendDeprecationWarning, setHidden, setItemGroup, setRecipe, setRecipeOutput, setRecipeType, setResearch, setUseableInWorkbench, toString, warnMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Field Details
-
TALISMANS_ITEMGROUP
-
suffix
-
consumable
protected final boolean consumable -
cancel
protected final boolean cancel -
effects
-
chance
protected final int chance
-
-
Constructor Details
-
Talisman
@ParametersAreNonnullByDefault public Talisman(SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, @Nullable String messageSuffix, PotionEffect... effects) -
Talisman
@ParametersAreNonnullByDefault public Talisman(SlimefunItemStack item, ItemStack[] recipe, @Nullable String messageSuffix, int chance, PotionEffect... effects) -
Talisman
@ParametersAreNonnullByDefault public Talisman(SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, @Nullable String messageSuffix, int chance, PotionEffect... effects) -
Talisman
@ParametersAreNonnullByDefault protected Talisman(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, @Nullable String messageSuffix, int chance, PotionEffect... effects)
-
-
Method Details
-
isConsumable
public boolean isConsumable()This returns whether theTalismanwill be consumed upon use.- Returns:
- Whether this
Talismanis consumed on use.
-
getChance
public int getChance()This returns the chance of thisTalismanactivating. The chance will be between 1 and 100.- Returns:
- The chance of this
Talismanactivating.
-
getEffects
-
isEventCancelled
protected boolean isEventCancelled() -
postRegister
public void postRegister()Description copied from class:SlimefunItemThis method is called afterSlimefunItem.register(SlimefunAddon). Override this method to add any additional setup that needs to happen after the original registration of thisSlimefunItem.- Overrides:
postRegisterin classSlimefunItem
-
load
public void load()Description copied from class:SlimefunItemThis method is used for internal purposes only.- Overrides:
loadin classSlimefunItem
-
trigger
-
trigger
@ParametersAreNonnullByDefault public static boolean trigger(Event e, SlimefunItemStack stack, boolean sendMessage) -
trigger
-
trigger
@ParametersAreNonnullByDefault public static boolean trigger(Event e, SlimefunItem item, boolean sendMessage) -
isSilent
public boolean isSilent()This returns whether theTalismanis silent. A silentTalismanwill not send a message to aPlayerwhen activated.- Returns:
- Whether this
Talismanis silent
-
getMessageSuffix
-
sendMessage
This method sends the givenPlayerthe message of thisTalisman. Dependent on the selected config setting, the message will be sent via the actionbar or in the chat window.- Parameters:
p- ThePlayerwho shall receive the message
-