Interface CustomUseEffectsItem

All Known Implementing Classes:
SandPaperItem

public interface CustomUseEffectsItem
  • Method Summary

    Modifier and Type
    Method
    Description
    default Boolean
    shouldTriggerUseEffects(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.LivingEntity entity)
    Called to determine if use effects should be applied for this item.
    boolean
    triggerUseEffects(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.LivingEntity entity, int count, Random random)
    Called when use effects should be applied for this item.
  • Method Details

    • shouldTriggerUseEffects

      default Boolean shouldTriggerUseEffects(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.LivingEntity entity)
      Called to determine if use effects should be applied for this item.
      Parameters:
      stack - The ItemStack being used.
      entity - The LivingEntity using the item.
      Returns:
      null for default behavior, or boolean to override default behavior
    • triggerUseEffects

      boolean triggerUseEffects(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.LivingEntity entity, int count, Random random)
      Called when use effects should be applied for this item.
      Parameters:
      stack - The ItemStack being used.
      entity - The LivingEntity using the item.
      count - The amount of times effects should be applied. Can safely be ignored.
      random - The LivingEntity's Random.
      Returns:
      if the default behavior should be cancelled or not