Class ItemScrollColonyAreaTP

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 ItemScrollColonyAreaTP extends AbstractItemScroll
Colony teleport scroll, which teleports the user and any nearby players to the colony, invite a friend-style
  • 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
    ItemScrollColonyAreaTP(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 void
    doTeleport(net.minecraft.server.level.ServerPlayer player, IColony colony, net.minecraft.world.item.ItemStack stack)
    Does the teleport action
    int
    getUseDuration(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.LivingEntity livingEntity)
     
    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)
     

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

    finishUsingItem, getColony, getColonyView, getUseAnimation, use, useOn

    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

    • ItemScrollColonyAreaTP

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

    • getUseDuration

      public int getUseDuration(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.LivingEntity livingEntity)
      Overrides:
      getUseDuration in class AbstractItemScroll
    • 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
    • doTeleport

      protected void doTeleport(net.minecraft.server.level.ServerPlayer player, IColony colony, net.minecraft.world.item.ItemStack stack)
      Does the teleport action
      Parameters:
      player - user of the item
      colony - colony to teleport to
    • 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