Class AstralArmorItem

java.lang.Object
net.minecraft.item.Item
net.minecraft.item.ArmorItem
dev.jaxydog.astral.content.item.AstralArmorItem
All Implemented Interfaces:
Custom, LoreHolder, Registered, Registered.Common, net.fabricmc.fabric.api.item.v1.FabricItem, net.minecraft.item.Equipment, net.minecraft.item.ItemConvertible, net.minecraft.item.Vanishable, net.minecraft.resource.featuretoggle.ToggleableFeature
Direct Known Subclasses:
CloudyArmorItem

public class AstralArmorItem extends net.minecraft.item.ArmorItem implements Custom, LoreHolder
An extension of an ArmorItem that provides commonly used functionality.

This is one of the various instances of already-provided wrapper classes for commonly used types.

In future code, you should prefer to extend this class over ArmorItem if at all possible.

This type is automatically registered.

Since:
2.0.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Implements the ArmorMaterial interface as a buildable class.

    Nested classes/interfaces inherited from class net.minecraft.item.ArmorItem

    net.minecraft.item.ArmorItem.Type

    Nested classes/interfaces inherited from class net.minecraft.item.Item

    net.minecraft.item.Item.Settings

    Nested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered

    Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server
  • Field Summary

    Fields inherited from class net.minecraft.item.ArmorItem

    DISPENSER_BEHAVIOR, knockbackResistance, material, type

    Fields inherited from class net.minecraft.item.Item

    ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, DEFAULT_MAX_COUNT, DEFAULT_MAX_USE_TIME, ITEM_BAR_STEPS

    Fields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature

    FEATURE_ENABLED_REGISTRY_KEYS
  • Constructor Summary

    Constructors
    Constructor
    Description
    AstralArmorItem(String path, net.minecraft.item.ArmorMaterial material, net.minecraft.item.ArmorItem.Type type, net.minecraft.item.Item.Settings settings)
    Creates a new armor item using the given settings.
    AstralArmorItem(String path, net.minecraft.item.ArmorMaterial material, net.minecraft.item.ArmorItem.Type type, net.minecraft.item.Item.Settings settings, @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup)
    Creates a new armor item using the given settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    appendTooltip(net.minecraft.item.ItemStack stack, @Nullable net.minecraft.world.World world, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext context)
     
    int
    getArmorTextureLayers(net.minecraft.item.ItemStack stack)
    Returns the total number of armor texture layers that this item stack expects to render.
    Optional<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>>
    Returns this item's preferred item group.
    Returns this value's associated registry identifier path.

    Methods inherited from class net.minecraft.item.ArmorItem

    canRepair, dispenseArmor, getAttributeModifiers, getEnchantability, getEquipSound, getMaterial, getProtection, getSlotType, getToughness, getType, use

    Methods inherited from class net.minecraft.item.Item

    asItem, byRawId, canBeNested, canMine, damage, finishUsing, fromBlock, getDefaultStack, getDrinkSound, getEatSound, getFoodComponent, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getRegistryEntry, getRequiredFeatures, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isItemBarVisible, isNbtSynced, isNetworkSynced, isSuitableFor, isUsedOnRelease, onClicked, onCraft, onItemEntityDestroyed, onStackClicked, onStoppedUsing, postHit, postMine, postProcessNbt, raycast, toString, usageTick, useOnBlock, useOnEntity

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface dev.jaxydog.astral.content.item.Custom

    registerCommon

    Methods inherited from interface net.minecraft.item.Equipment

    equipAndSwap

    Methods inherited from interface net.fabricmc.fabric.api.item.v1.FabricItem

    allowContinuingBlockBreaking, allowNbtUpdateAnimation, getAttributeModifiers, getRecipeRemainder, isSuitableFor

    Methods inherited from interface net.minecraft.item.ItemConvertible

    asItem

    Methods inherited from interface dev.jaxydog.astral.content.item.LoreHolder

    formatLoreText, getLoreTooltips

    Methods inherited from interface dev.jaxydog.astral.register.Registered

    getRegistryId

    Methods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature

    isEnabled
  • Constructor Details

    • AstralArmorItem

      public AstralArmorItem(String path, net.minecraft.item.ArmorMaterial material, net.minecraft.item.ArmorItem.Type type, net.minecraft.item.Item.Settings settings, @Nullable @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup)
      Creates a new armor item using the given settings.

      If the preferredGroup supplier is null, this item will not be added to any item groups.

      Parameters:
      path - The item's identifier path.
      material - The armor's material.
      type - The armor's type.
      settings - The item's settings.
      preferredGroup - The item's preferred item group.
      Since:
      2.0.0
    • AstralArmorItem

      public AstralArmorItem(String path, net.minecraft.item.ArmorMaterial material, net.minecraft.item.ArmorItem.Type type, net.minecraft.item.Item.Settings settings)
      Creates a new armor item using the given settings.

      This item will not be added to any item groups.

      Parameters:
      path - The item's identifier path.
      material - The armor's material.
      type - The armor's type.
      settings - The item's settings.
      Since:
      2.0.0
  • Method Details

    • getArmorTextureLayers

      public int getArmorTextureLayers(net.minecraft.item.ItemStack stack)
      Returns the total number of armor texture layers that this item stack expects to render.

      This method allows for armor items to have multiple texture layers per item.

      Parameters:
      stack - The item stack.
      Returns:
      The number of texture layers.
      Since:
      2.0.0
    • appendTooltip

      public void appendTooltip(net.minecraft.item.ItemStack stack, @Nullable @Nullable net.minecraft.world.World world, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext context)
      Overrides:
      appendTooltip in class net.minecraft.item.Item
    • getItemGroup

      public Optional<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> getItemGroup()
      Description copied from interface: Custom
      Returns this item's preferred item group.
      Specified by:
      getItemGroup in interface Custom
      Returns:
      A reference to an item group.
    • getRegistryPath

      public String getRegistryPath()
      Description copied from interface: Registered
      Returns this value's associated registry identifier path.

      This is by default used to determine the Identifier provided by Registered.getRegistryId(). For example, returning "my_item" will cause the associated identifier to be astral:my_item.

      Specified by:
      getRegistryPath in interface Registered
      Returns:
      An identifier path.