Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MonsterPlacerDataLoyalist extends Item {
- public MonsterPlacerDataLoyalist() {
- this.setHasSubtypes(false);
- this.setCreativeTab(CreativeTabs.tabMisc);
- this.setUnlocalizedName("itemDataSwordmanSpawn");
- }
- public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
- return stack;
- }
- public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int sideHit, float hitX, float hitY, float hitZ)
- {
- if (!world.isRemote) {
- /*
- Unknown error happened before, so this code was left behind.
- EntityDataLoyalist loyalist = new EntityDataLoyalist(world);
- loyalist.setLocationAndAngles(x, y, z, 0, 0);
- world.spawnEntityInWorld(loyalist);
- return true;
- */
- EntityZombie zombie = new EntityZombie(world);
- zombie.setLocationAndAngles(x, y+2, z, 0, 0);
- world.spawnEntityInWorld(zombie);
- EntityDataSwordman swordman = new EntityDataSwordman(world);
- swordman.setLocationAndAngles(x, y+2, z, 0, 0);
- swordman.setVelocity(0, 2, 0);
- world.spawnEntityInWorld(swordman);
- EntitySkeleton skeleton = new EntitySkeleton(world);
- skeleton.setLocationAndAngles(x, y, z, 0, 0);
- world.spawnEntityInWorld(skeleton);
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment