i want to create an entity and change its meta data. i want to spawn a player entity. How can i do this?
Try this library: Remote Entities. Human Entities have been removed for a while, but using modified packets you can "spawn" players. That's how most plugins that have NPCs do it. With that plugin you could do something like this: Code: EntityManager manager = RemoteEntities.createManager(this); RemoteEntity entity = manager.createEntity(RemoteEntity.Human, Bukkit.getWorld("world").getSpawnLocation(), true); Then you can add goals to make it do what you want.
The forum post says 1.4.4/1.4.5 but you can download the 1.4-SNAPSHOT version from here which should work with 1.4.6.
ok but i currently have 8 diffrent libarys and im trying to cut them down. ive done 2, just 8 to go. theres surly a way to do it as in the apis you can spawn player (or can you spawn a vilager and set it to player)
Create an net.minecraft.server.<version>.EntityPlayer and use that in the Packet20NamedEntitySpawn packet
thanks but how would i initialise an entity to be a villager: Code: Entity ent = new Entity(); thats what i tried but its wrong
Try something like this: Code: World w = getServer().getWorld("world") Entity ent = w.spawnEntity(Location, EntityType.VILLAGER); Edit: where Location is the org.bukkit.Location where you want it to spawn and w is the world you want it to spawn in
i know that works but im trying to do something else (set meta data as it works on other things). but i need to initalize the variable