Chicken Wing Posted September 11, 2015 Share Posted September 11, 2015 (edited) How do I check if there is an entity at a certain position? EDIT: I mean get a reference to an entity using a position oopsy Edited September 11, 2015 by Chicken Wing Quote Link to comment Share on other sites More sharing options...
Precise Posted September 11, 2015 Share Posted September 11, 2015 How do I check if there is an entity at a certain position? #ENTITY HERE#getPosition().equals(the position); 1 Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted September 11, 2015 Author Share Posted September 11, 2015 #ENTITY HERE#getPosition().equals(the position); Is there a way to get a reference to an entity other than using objects.closest()? Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted September 11, 2015 Share Posted September 11, 2015 EntityAPI.get(x,y) returns a list of entities on pos x,y,z with z = myPlayer.getZ()!EntityAPI.get(x,y).isEmpty() --> there is something at position x,yEntityAPI is one of npcs, objects, grounditems Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted September 11, 2015 Author Share Posted September 11, 2015 (edited) EntityAPI.get(x,y) returns a list of entities on pos x,y,z with z = myPlayer.getZ() !EntityAPI.get(x,y).isEmpty() --> there is something at position x,y EntityAPI is one of npcs, objects, grounditems This is exactly what I was looking for, thank you EDIT: EntityAPI is an abstract class? So I have to make those methods myself? I think I've found a solution to my problem so its ok now anyway. Edited September 11, 2015 by Chicken Wing Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted September 11, 2015 Share Posted September 11, 2015 This is exactly what I was looking for, thank you EDIT: EntityAPI is an abstract class? So I have to make those methods myself? I think I've found a solution to my problem so its ok now anyway. Yes it is an abstract class, subclassed by concrete classes Objects, NPCS and GroundItems. So you could do objects.get(x,y) or npcs.get(x,y) or groundItems.get(x,y) Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted September 11, 2015 Author Share Posted September 11, 2015 Yes it is an abstract class, subclassed by concrete classes Objects, NPCS and GroundItems. So you could do objects.get(x,y) or npcs.get(x,y) or groundItems.get(x,y) Oh I didn't realise it was the parent class (/facepalm), TY! Quote Link to comment Share on other sites More sharing options...