Posted June 14, 201510 yr I tried entity.heal(20);, but it seems it doesnt work. Do I need to call additional functions / do it in server side?
June 14, 201510 yr / do it in server side? Of course! Any game affective changes on must happen on server! Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 14, 201510 yr Author It does not seem right... Here's my code: EntityPlayer priority = the nearest player from tile entity; if (!worldObj.isRemote) { priority.heal(20); } I tried falling from a cliff and come back, but it does not heal me! My debug printings suggest the TileEntity has found me as a target, but it does not heal!
June 14, 201510 yr It does not seem right... Here's my code: EntityPlayer priority = the nearest player from tile entity; if (!worldObj.isRemote) { priority.heal(20); } I tried falling from a cliff and come back, but it does not heal me! My debug printings suggest the TileEntity has found me as a target, but it does not heal! Are you sure that player is not null? And that it's you? And that whole code block is getting called on server side? And that code succesfully reaches priority.heal? Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 14, 201510 yr Author More than Infinity% sure I have my code print who's being targetted, and yeah, no NullPointer baddies, it points to me, but no health updates!!!
June 14, 201510 yr show your code please. we cant tell you the problem without any further informations
June 14, 201510 yr Author Just found that my code doesnt execute in server. Anyways: TileEntity in question: http://pastebin.com/DycFqfRq
June 14, 201510 yr Author Oh, I got it!!! That TileEntity in my world is from an old version... That explains the strange behavior.
June 14, 201510 yr Be aware that your code will crash a Server. The class Minecraft is non existant on a server
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.