Is there any way to give mobs armor, that works for the latest craftbukkit version? I want a simple function that takes in (ItemStack),(slot int) and (Entity) and will change the entity's equiptment
You're after entity.getEquipment() - Gives you an EntityEquipment object that allows you to set the armor, item in hand, and drop chances.
hatstand I did try this, but i can't convert Entity to EntityLiving to use this, is there any other way?
Check if the entity is an instance of EntityLiving, if it is, cast it. Unless you want to go digging around in CB internal stuff, which is a terrible idea, and more complex than that.
hatstand When I cast it, the console just gives errors java.lang.ClassCastException: org.bukkit.craftbukkit.v1_4_R1.entity.CraftZombie cannot be cast to net.minecraft.server.v1_4_R1.EntityLiving
Just double checked that, you're after LivingEntity, not EntityLiving - The former is a Bukkit class, the latter is an NMS class. Hence the exception. For reference, this is a similar section of code I'm using: Code: EntityType type = event.getEntityType(); if(type == EntityType.ZOMBIE || type == EntityType.SKELETON) { SpawnReason reason = event.getSpawnReason(); if(reason == SpawnReason.NATURAL) { LivingEntity entity = event.getEntity(); EntityEquipment equips = entity.getEquipment(); This is in a handler for a CreatureSpawnEvent, so I don't need to cast it.