Class ItemScrollGuardHelp

java.lang.Object
net.minecraft.world.item.Item
All Implemented Interfaces:
net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike, net.neoforged.neoforge.common.extensions.IItemExtension

public class ItemScrollGuardHelp extends AbstractItemScroll
Magic scroll which summons guards to the users aid, with a limited duration. Only works within the same world as the colony.
  • 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
  • Field Summary

    Fields inherited from class com.minecolonies.core.items.AbstractItemScroll

    FAIL_RESPONSES_TOTAL

    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
    ItemScrollGuardHelp(net.minecraft.world.item.Item.Properties properties)
    Sets the name, creative tab, and registers the item.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    appendHoverText(@NotNull net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item.TooltipContext ctx, @NotNull List<net.minecraft.network.chat.Component> tooltip, @NotNull net.minecraft.world.item.TooltipFlag flagIn)
     
    protected boolean
    Whether this items need to register to a colony
    protected net.minecraft.world.item.ItemStack
    onItemUseSuccess(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, net.minecraft.server.level.ServerPlayer player)
    Called when the item gets used
    void
    onUseTick(net.minecraft.world.level.Level worldIn, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int count)
     
    @NotNull net.minecraft.world.InteractionResult
    useOn(net.minecraft.world.item.context.UseOnContext ctx)
     

    Methods inherited from class com.minecolonies.core.items.AbstractItemScroll

    finishUsingItem, getColony, getColonyView, getUseAnimation, getUseDuration, use

    Methods inherited from class net.minecraft.world.item.Item

    asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canFitInsideContainerItems, components, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getTooltipImage, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, isValidRepairItem, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, toString, 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, canPerformAction, 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
  • Constructor Details

    • ItemScrollGuardHelp

      public ItemScrollGuardHelp(net.minecraft.world.item.Item.Properties properties)
      Sets the name, creative tab, and registers the item.
      Parameters:
      properties - the properties.
  • Method Details

    • onItemUseSuccess

      protected net.minecraft.world.item.ItemStack onItemUseSuccess(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, net.minecraft.server.level.ServerPlayer player)
      Description copied from class: AbstractItemScroll
      Called when the item gets used
      Specified by:
      onItemUseSuccess in class AbstractItemScroll
      Parameters:
      itemStack - stack thats used
      world - world its used in
      player - player its used by
      Returns:
      stack
    • needsColony

      protected boolean needsColony()
      Description copied from class: AbstractItemScroll
      Whether this items need to register to a colony
      Specified by:
      needsColony in class AbstractItemScroll
      Returns:
      true if so
    • useOn

      @NotNull public @NotNull net.minecraft.world.InteractionResult useOn(net.minecraft.world.item.context.UseOnContext ctx)
      Overrides:
      useOn in class AbstractItemScroll
    • onUseTick

      public void onUseTick(net.minecraft.world.level.Level worldIn, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int count)
      Overrides:
      onUseTick in class net.minecraft.world.item.Item
    • appendHoverText

      public void appendHoverText(@NotNull @NotNull net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.world.item.Item.TooltipContext ctx, @NotNull @NotNull List<net.minecraft.network.chat.Component> tooltip, @NotNull @NotNull net.minecraft.world.item.TooltipFlag flagIn)
      Overrides:
      appendHoverText in class net.minecraft.world.item.Item