Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onSpawn(CreatureSpawnEvent event){
- if (event.isCancelled()) return;
- Location location = event.getLocation();
- Entity entity = event.getEntity();
- EntityType creatureType = event.getEntityType();
- World world = location.getWorld();
- net.minecraft.server.World mcWorld = ((CraftWorld) world).getHandle();
- net.minecraft.server.Entity mcEntity = (((CraftEntity) entity).getHandle());
- if (creatureType == EntityType.VILLAGER && mcEntity instanceof HumanNPC == false){
- HumanNPC npc = new HumanNPC(((CraftServer)Bukkit.getServer()).getServer(), mcWorld, "Bard", new ItemInWorldManager(mcWorld));
- npc.setPosition(location.getX(), location.getY(), location.getZ());
- mcWorld.removeEntity((net.minecraft.server.EntityVillager) mcEntity);
- mcWorld.addEntity(npc, SpawnReason.CUSTOM);
- return;
- }
- public void onSpawn2(CreatureSpawnEvent event){
- if (event.isCancelled()) return;
- Location location = event.getLocation();
- Entity entity = event.getEntity();
- EntityType creatureType = event.getEntityType();
- World world = location.getWorld();
- net.minecraft.server.World mcWorld = ((CraftWorld) world).getHandle();
- net.minecraft.server.Entity mcEntity = (((CraftEntity) entity).getHandle());
- if (creatureType == EntityType.VILLAGER && mcEntity instanceof HumanNPC == false){
- HumanNPC npc = new HumanNPC(((CraftServer)Bukkit.getServer()).getServer(), mcWorld, "Archer", new ItemInWorldManager(mcWorld));
- npc.setPosition(location.getX(), location.getY(), location.getZ());
- mcWorld.removeEntity((net.minecraft.server.EntityVillager) mcEntity);
- mcWorld.addEntity(npc, SpawnReason.CUSTOM);
- return;
- }
- public void onSpawn3(CreatureSpawnEvent event){
- if (event.isCancelled()) return;
- Location location = event.getLocation();
- Entity entity = event.getEntity();
- EntityType creatureType = event.getEntityType();
- World world = location.getWorld();
- net.minecraft.server.World mcWorld = ((CraftWorld) world).getHandle();
- net.minecraft.server.Entity mcEntity = (((CraftEntity) entity).getHandle());
- if (creatureType == EntityType.VILLAGER && mcEntity instanceof HumanNPC == false){
- HumanNPC npc = new HumanNPC(((CraftServer)Bukkit.getServer()).getServer(), mcWorld, "Diamond", new ItemInWorldManager(mcWorld));
- npc.setPosition(location.getX(), location.getY(), location.getZ());
- mcWorld.removeEntity((net.minecraft.server.EntityVillager) mcEntity);
- mcWorld.addEntity(npc, SpawnReason.CUSTOM);
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement