Solved Spawn mobs with items from spawner

Discussion in 'Plugin Development' started by OkayName, Apr 7, 2021 at 3:23 PM.

  1. Offline

    OkayName

    Hey! I recently got into plugin development, and I decided to start off with something simple. I decided to make custom spawners, which would spawn mobs with items. I tried looking around, but I couldn't find a solution on how to spawn mobs with items or armor, only how to spawn regular mobs. Thanks in advance!
     
  2. Offline

    Kars

    You catch SpawnerSpawnEvent and use getEntity to get the entity.
    From there you can use getEquipment to get the EntityEquipment (object) for the entity, and then use something like setItemInHand.
     
    davidclue likes this.
  3. Offline

    OkayName

    Ok thanks, it worked. Im gonna mark the thread as solved!
     

Share This Page