Solved Changing mob drops

Discussion in 'Spigot Plugin Development' started by NeverFlame42, Jul 5, 2021.

  1. So in a plugin I'm making, I want chickens to drop 1-3 eggs on death. Can you do this with just a plugin? The things I'm found on the matter is by using Datapacks to change loot tables.

    Any help is appreciated.
  2. entity death event.getDrops.add()?
    • Informative Informative x 1
  3. Thanks, I didn't think it would be that easy.

    Also, is this:
    Code (Java):
    what you would put into an if statement, or do you need to compare it in a different way?

    Edit: that didn't work

    Edit2: for it to work, because the if statement was the reason it didn't work, you need to use this:
    Code (Java):
    event.getEntityType() == EntityType.CHICKEN
    #3 NeverFlame42, Jul 5, 2021
    Last edited: Jul 5, 2021
  4. It’s an enum use ==, clear all the drops and spawn your own
    • Agree Agree x 1