Solved How to create wither skeleton spawn egg

Discussion in 'Plugin Development' started by Fitcher, Aug 24, 2021.

Thread Status:
Not open for further replies.
  1. Offline


    Hello, i was trying to create a wither skeleton spawn egg ItemStack, i'm using this code:

    ItemStack item = new ItemStack(Material.MONSTER_EGG, 1, EntityType.WITHER_SKELETON.getTypeId());
    This code works fine for any other spawn egg, but with wither skeleton it creates this:


    I'm using paper-1.12.2 API
  2. Offline


    You need to create the monster egg, get it's meta, cast it to SpawnEggMeta, set the entity type then set the meta back.
  3. Offline


    Thanks, it worked!
    Strahan likes this.
Thread Status:
Not open for further replies.

Share This Page