Package com.minecolonies.core.items
Class ItemSpear
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.TridentItem
com.minecolonies.core.items.ItemSpear
- All Implemented Interfaces:
net.minecraft.world.flag.FeatureElement,net.minecraft.world.item.Vanishable,net.minecraft.world.level.ItemLike,net.minecraftforge.common.extensions.IForgeItem
public class ItemSpear
extends net.minecraft.world.item.TridentItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
net.minecraft.world.item.Item.Properties -
Field Summary
FieldsFields inherited from class net.minecraft.world.item.TridentItem
BASE_DAMAGE, SHOOT_POWER, THROW_THRESHOLD_TIMEFields inherited from class net.minecraft.world.item.Item
BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZEFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPerformAction(net.minecraft.world.item.ItemStack stack, net.minecraftforge.common.ToolAction toolAction) For cavalry use, allow the spear to be used as a melee weapon, so allow the default sword actions.intGets the base damage of the spear.voidinitializeClient(Consumer<net.minecraftforge.client.extensions.common.IClientItemExtensions> consumer) voidreleaseUsing(@NotNull net.minecraft.world.item.ItemStack stack, @NotNull net.minecraft.world.level.Level worldIn, @NotNull net.minecraft.world.entity.LivingEntity entityLiving, int timeLeft) @NotNull net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack>use(@NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player playerEntity, @NotNull net.minecraft.world.InteractionHand hand) Methods inherited from class net.minecraft.world.item.TridentItem
canAttackBlock, getDefaultAttributeModifiers, getEnchantmentValue, getUseAnimation, getUseDuration, hurtEnemy, mineBlockMethods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, finishUsingItem, getBarColor, getBarWidth, getCraftingRemainingItem, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getFoodProperties, getId, getMaxDamage, getMaxStackSize, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getRenderPropertiesInternal, getTooltipImage, hasCraftingRemainingItem, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isFoil, isRepairable, isValidRepairItem, onCraftedBy, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, requiredFeatures, shouldOverrideMultiplayerNbt, toString, useOn, useOnRelease, verifyTagAfterLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface net.minecraftforge.common.extensions.IForgeItem
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultTooltipHideFlags, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getShareTag, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, initCapabilities, isBookEnchantable, isCorrectToolForDrops, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onStopUsing, readShareTag, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Field Details
-
SPEAR_BASE_DAMAGE
protected static final int SPEAR_BASE_DAMAGE- See Also:
-
-
Constructor Details
-
ItemSpear
public ItemSpear(net.minecraft.world.item.Item.Properties properties)
-
-
Method Details
-
initializeClient
public void initializeClient(Consumer<net.minecraftforge.client.extensions.common.IClientItemExtensions> consumer) - Overrides:
initializeClientin classnet.minecraft.world.item.Item
-
releaseUsing
public void releaseUsing(@NotNull @NotNull net.minecraft.world.item.ItemStack stack, @NotNull @NotNull net.minecraft.world.level.Level worldIn, @NotNull @NotNull net.minecraft.world.entity.LivingEntity entityLiving, int timeLeft) - Overrides:
releaseUsingin classnet.minecraft.world.item.TridentItem
-
use
@NotNull public @NotNull net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack> use(@NotNull @NotNull net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player playerEntity, @NotNull @NotNull net.minecraft.world.InteractionHand hand) - Overrides:
usein classnet.minecraft.world.item.TridentItem
-
canPerformAction
public boolean canPerformAction(net.minecraft.world.item.ItemStack stack, net.minecraftforge.common.ToolAction toolAction) For cavalry use, allow the spear to be used as a melee weapon, so allow the default sword actions.- Parameters:
stack- the item stack.toolAction- the tool action.- Returns:
- true if the action can be performed.
-
getDamage
public int getDamage()Gets the base damage of the spear.- Returns:
- the base damage of the spear.
-