Solved Put saddle N stuff on Horse?

Discussion in 'Plugin Development' started by Meatiex, Jan 21, 2015.

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

    Meatiex

    How would I:
    put saddle on horse
    put armor on horse
    put chests on donkeys?

    I manged to put chests on about %20 donkeys that spawn with the code below, I'm not sure why its not %100
    Code:
            @EventHandler
            public void spawn(EntitySpawnEvent event) {
                Entity entity = event.getEntity();
           if (entity.getType() == EntityType.HORSE) {
                    Horse horse = (Horse)entity;
                    horse.setTamed(true);
                    horse.setAdult();
                    if (horse.getVariant() == Variant.DONKEY || horse.getVariant() == Variant.MULE)
                        horse.setCarryingChest(true);
                }
            }
     
  2. Offline

    1Rogue

    Helps to read the javadocs. Horse#getInventory() returns a HorseInventory
     
Thread Status:
Not open for further replies.

Share This Page