Enderdragon drop

Discussion in 'Plugin Development' started by MieskeB, Aug 15, 2019.

  1. Offline

    MieskeB

    Hey! I have a problem. When I try to add an item to the drop of an ender dragon, it doesn't drop anything. I think this might be the problem of the explosion effects that instantly destroy the item? Does someone have a (simple) solution to this problem?

    @EventHandler
    public void entityDeath(EntityDeathEvent event) {
    if (event.getEntity() instanceof EnderDragon) {
    event.getDrops().add(new ItemStack(Material.ELYTRA, 1));
    }
    }
     
  2. Offline

    KarimAKL

    @MieskeB Did you remember to register the event? If yes, then i'm not sure why it wouldn't work (unless the if statement returns false).
     
    MieskeB likes this.
  3. Offline

    MieskeB

    @KarimAKL Hmm ow yea I forgot to register the event sorry thank you!
     
    KarimAKL likes this.
  4. Offline

    KarimAKL

    @MieskeB Remember to set the title prefix to solved.
     

Share This Page