Interface ItemDecay


public interface ItemDecay
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static net.minecraft.world.item.ItemStack
    checkDecay(net.minecraft.world.item.ItemStack stack)
    Get the form of the given ItemStack accounting for the current game time and any possible IDecayProducts the Item has.
    static net.minecraft.world.item.ItemStack
    checkDecay(net.minecraft.world.item.ItemStack stack, UnaryOperator<net.minecraft.world.item.ItemStack> newDecay)
    Get the form of the given ItemStack accounting for the current game time and any possible IDecayProducts the Item has.
    static net.minecraft.world.item.ItemStack
    copyIgnoringDecay(net.minecraft.world.item.ItemStack stack)
     
    static void
    extendLifetime(net.minecraft.world.item.ItemStack decayingItemStack, int additionalLifetime)
     
    static long
     
    static long
    getLifetimeOrNone(net.minecraft.world.item.ItemStack stack)
     
    static long
    getRemainingTime(long lifetime, long creationTime)
     
    static long
    getRemainingTime(net.minecraft.world.item.ItemStack decayingItemStack, long creationTime)
     
    static Optional<net.minecraft.network.chat.Component>
    getTooltip(net.minecraft.world.item.ItemStack stack)
     
    static net.minecraft.world.item.ItemStack
    removeAppliedDecay(net.minecraft.world.item.ItemStack stack)
     
    static void
    startDecay(net.minecraft.world.item.ItemStack stack)
     
    static void
    startDecay(net.minecraft.world.item.ItemStack stack, long timeElapsed)
     
  • Method Details

    • getGameTime

      static long getGameTime()
    • checkDecay

      static net.minecraft.world.item.ItemStack checkDecay(net.minecraft.world.item.ItemStack stack)
      Get the form of the given ItemStack accounting for the current game time and any possible IDecayProducts the Item has. This is recursive and will give the ItemStack accurate to the original decay start time.
      Parameters:
      stack -
      Returns:
      The "true" ItemStack, accounting for that into which it may have decayed
      See Also:
    • checkDecay

      static net.minecraft.world.item.ItemStack checkDecay(net.minecraft.world.item.ItemStack stack, UnaryOperator<net.minecraft.world.item.ItemStack> newDecay)
      Get the form of the given ItemStack accounting for the current game time and any possible IDecayProducts the Item has. This is recursive and will give the ItemStack accurate to the original decay start time.
      Parameters:
      stack -
      newDecay - Use this to get a different decay for the product, beyond any decay added by its prototype or the IDecayProduct
      Returns:
      The "true" ItemStack, accounting for that into which it may have decayed
      See Also:
    • copyIgnoringDecay

      static net.minecraft.world.item.ItemStack copyIgnoringDecay(net.minecraft.world.item.ItemStack stack)
    • removeAppliedDecay

      static net.minecraft.world.item.ItemStack removeAppliedDecay(net.minecraft.world.item.ItemStack stack)
    • getLifetimeOrNone

      static long getLifetimeOrNone(net.minecraft.world.item.ItemStack stack)
    • getRemainingTime

      static long getRemainingTime(net.minecraft.world.item.ItemStack decayingItemStack, long creationTime)
    • getRemainingTime

      static long getRemainingTime(long lifetime, long creationTime)
    • startDecay

      static void startDecay(net.minecraft.world.item.ItemStack stack)
    • startDecay

      static void startDecay(net.minecraft.world.item.ItemStack stack, long timeElapsed)
    • extendLifetime

      static void extendLifetime(net.minecraft.world.item.ItemStack decayingItemStack, int additionalLifetime)
    • getTooltip

      static Optional<net.minecraft.network.chat.Component> getTooltip(net.minecraft.world.item.ItemStack stack)