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.TooltipContext

    Nested classes/interfaces inherited from interface net.minecraft.world.item.ProjectileItem

    net.minecraft.world.item.ProjectileItem.DispenseConfig, net.minecraft.world.item.ProjectileItem.PositionFunction
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
     

    Fields inherited from class net.minecraft.world.item.TridentItem

    BASE_DAMAGE, SHOOT_POWER, THROW_THRESHOLD_TIME

    Fields 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_WIDTH

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemSpear(net.minecraft.world.item.Item.Properties properties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    int
    Gets the base damage of the spear.
    void
    releaseUsing(@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, postHurtEnemy

    Methods 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, verifyComponentsAfterLoad

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled

    Methods 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, supportsEnchantment

    Methods inherited from interface net.minecraft.world.item.ProjectileItem

    createDispenseConfig, shoot
  • Field Details

  • 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:
      releaseUsing in class net.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:
      use in class net.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:
      canPerformAction in interface net.neoforged.neoforge.common.extensions.IItemExtension
      Overrides:
      canPerformAction in class net.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.