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.ProjectileItem,net.minecraft.world.level.ItemLike,net.neoforged.neoforge.common.extensions.IItemExtension
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, net.minecraft.world.item.Item.TooltipContextNested classes/interfaces inherited from interface net.minecraft.world.item.ProjectileItem
net.minecraft.world.item.ProjectileItem.DispenseConfig, net.minecraft.world.item.ProjectileItem.PositionFunction -
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
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canRepair, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTHFields 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.neoforged.neoforge.common.ItemAbility itemAbility) 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.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
asProjectile, canAttackBlock, createAttributes, createToolProperties, getEnchantmentValue, getUseAnimation, getUseDuration, hurtEnemy, postHurtEnemyMethods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getTooltipImage, hasCraftingRemainingItem, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, isValidRepairItem, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, requiredFeatures, toString, useOn, useOnRelease, verifyComponentsAfterLoadMethods 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.neoforged.neoforge.common.extensions.IItemExtension
applyEnchantments, canBeHurtBy, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantmentMethods inherited from interface net.minecraft.world.item.ProjectileItem
createDispenseConfig, shoot
-
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
-
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.neoforged.neoforge.common.ItemAbility itemAbility) For cavalry use, allow the spear to be used as a melee weapon, so allow the default sword actions.- Specified by:
canPerformActionin interfacenet.neoforged.neoforge.common.extensions.IItemExtension- Overrides:
canPerformActionin classnet.minecraft.world.item.TridentItem- Parameters:
stack- the item stack.itemAbility- the item ability.- 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.
-