Class StomperBoots
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.armor.StomperBoots
- All Implemented Interfaces:
Placeable
The Boots of the Stomper are boots which damage nearby enemies whenever the
Player
takes fall damage.- Author:
- TheBusyBiscuit
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench
-
Constructor Summary
ConstructorsConstructorDescriptionStomperBoots
(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canPush
(org.bukkit.entity.Player player, org.bukkit.entity.LivingEntity entity) Checks if the stomper boots can move an entity and is not the player who is using the boots.protected org.bukkit.util.Vector
getShockwave
(org.bukkit.Location origin, org.bukkit.Location target) This gives us the "shockwave"Vector
for a given target.void
stomp
(org.bukkit.event.entity.EntityDamageEvent fallDamageEvent) This will apply the "stomp" effect to the givenEntityDamageEvent
.Methods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, addWikiPage, callItemHandler, canUse, disable, enable, 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, load, loadDataByDefault, postRegister, preRegister, register, sendDeprecationWarning, setHidden, setItemGroup, setRecipe, setRecipeOutput, setRecipeType, setResearch, setUseableInWorkbench, toString, warn
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Constructor Details
-
StomperBoots
@ParametersAreNonnullByDefault public StomperBoots(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe)
-
-
Method Details
-
stomp
public void stomp(@Nonnull org.bukkit.event.entity.EntityDamageEvent fallDamageEvent) This will apply the "stomp" effect to the givenEntityDamageEvent
.- Parameters:
fallDamageEvent
- TheEntityDamageEvent
in which thePlayer
has taken fall damage
-
getShockwave
@Nonnull protected org.bukkit.util.Vector getShockwave(@Nonnull org.bukkit.Location origin, @Nonnull org.bukkit.Location target) This gives us the "shockwave"Vector
for a given target.- Parameters:
origin
- TheLocation
of ourPlayer
target
- TheLocation
of theEntity
we are pushing away- Returns:
- A
Vector
to determine the velocity for ourEntity
-
canPush
protected boolean canPush(@Nonnull org.bukkit.entity.Player player, @Nonnull org.bukkit.entity.LivingEntity entity) Checks if the stomper boots can move an entity and is not the player who is using the boots.For developers: If you're spawning an immovable NPC, you should be denying collision with
LivingEntity.setCollidable(boolean)
or gravity withEntity.setGravity(boolean)
.- Parameters:
player
- ThePlayer
using theStomperBoots
.entity
- TheLivingEntity
to check.- Returns:
- If the entity can move.
-