Class ToucanLivingDrops

java.lang.Object
com.jvn.toucanlib.neoforge.loot.ToucanLivingDrops

public final class ToucanLivingDrops extends Object
Convenience helpers for NeoForge living-drop events.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addDrop(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
    Adds an item stack to a living drop event at the entity's position.
    static boolean
    addDropIfNoMatchingItem(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
    Adds a drop when the event does not already contain the same item.
    static void
    drop(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack)
    Spawns an item stack from a living entity immediately.
    static boolean
    hasDropWithSameItem(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
    Returns true when the event already contains the same item.
    static boolean
    hasDropWithSameItemAndComponents(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
    Returns true when the event already contains the same item and components.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • addDrop

      public static void addDrop(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
      Adds an item stack to a living drop event at the entity's position.
    • addDropIfNoMatchingItem

      public static boolean addDropIfNoMatchingItem(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
      Adds a drop when the event does not already contain the same item.
    • hasDropWithSameItem

      public static boolean hasDropWithSameItem(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
      Returns true when the event already contains the same item.
    • hasDropWithSameItemAndComponents

      public static boolean hasDropWithSameItemAndComponents(net.neoforged.neoforge.event.entity.living.LivingDropsEvent event, net.minecraft.world.item.ItemStack stack)
      Returns true when the event already contains the same item and components.
    • drop

      public static void drop(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack)
      Spawns an item stack from a living entity immediately.