Advertisement
Guest User

Tile Entity

a guest
Jul 6th, 2014
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. package net.endernoobs.rpgmod;
  2.  
  3. import net.minecraft.tileentity.TileEntity;
  4.  
  5. public class TileEntityGrimReaper extends TileEntity {
  6. private int activatingRangeFromPlayer = 20;
  7.  
  8. public boolean isActivated() {
  9. return this.worldObj.getClosestPlayer((double) this.xCoord + 0.5D,
  10. (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D,
  11. (double) this.activatingRangeFromPlayer) != null;
  12. }
  13.  
  14. @Override
  15. public void updateEntity() {
  16. if (this.isActivated()) {
  17. if (!this.worldObj.isRemote){
  18. EntityGrimReaper boss =new EntityGrimReaper(worldObj);
  19. boss.setPosition(this.xCoord, this.yCoord, this.zCoord);
  20. this.worldObj.spawnEntityInWorld(boss);
  21. this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
  22. }
  23. }
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement