Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.endernoobs.rpgmod;
- import net.minecraft.tileentity.TileEntity;
- public class TileEntityGrimReaper extends TileEntity {
- private int activatingRangeFromPlayer = 20;
- public boolean isActivated() {
- return this.worldObj.getClosestPlayer((double) this.xCoord + 0.5D,
- (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D,
- (double) this.activatingRangeFromPlayer) != null;
- }
- @Override
- public void updateEntity() {
- if (this.isActivated()) {
- if (!this.worldObj.isRemote){
- EntityGrimReaper boss =new EntityGrimReaper(worldObj);
- boss.setPosition(this.xCoord, this.yCoord, this.zCoord);
- this.worldObj.spawnEntityInWorld(boss);
- this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement