1.14.4 Check if a certain entity is at location?

Discussion in 'Spigot Plugin Development' started by kinukin, Feb 1, 2020.

  1. How can I check if a certain entity is at a location? If so how can I check how much entities are at a location?
  2. World#getNearbyEntities and adapt the values for x,y and z accordingly
  3. It's also possible to check for coordinates of the destination and the entities location and compare them. You can then define the threshold yourself. And if you're lazy just do it like this. It would't really be a good idea to check the locations exactly, because it's unlikely that they would equal exactly.
    So just check if an entity is NEAR a location and not AT a location. And as Schottky already stated: You can get the entities nearby and simply count them.