Where is the location return by getLocation() at a TNTPrimed

Discussion in 'Spigot Plugin Development' started by Butzlabben, Aug 16, 2019.

  1. I want to code a plugin, in which I need the exact bounds of a primed TNT entity. I could calculate the with TNTPrimed#getLocation(), but where is this location at the entity? Is at the corner, is at an edge, is it in the middle of the entity?

    Thanks in advance
  2. Is getLocation() is int or double?
    if its int it gets the location of the block
    if its double it gets the exact location of the TNT, I mean if you do /tp 0.5 64 0.5 it will TP you to 0.5 64 0.5 and not 0 64 0.
  3. Entity#getLocation() returns a Location, not an int or a double.
    The OP wants to know which point at the hitbox the methods Location#getX(), ... return.
    • Agree Agree x 1
  4. Why you do not try it? Spawn an entity which does not move and compare the coordinates of his hitbox ingame with Location#getX(), etc...
  5. Use Location#getX, Location#getY, Location#getZ. If they are not the same as Location#getBlockX.. and so on, then it means it returns the location given at the very last tick right before they get to *boom*.