Get location of dropped item doesn't work

Discussion in 'Plugin Development' started by Regenwurm97, Jun 19, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Regenwurm97

    Hey there!

    I need to find out the location of a dropped item after specific intervalls.
    I used a Sync. Timer, calling my run() every 20 ticks / 1 second to print out the current height of the item:

    Code:
    double y = item.getLocation().getY();
    System.out.println("Y: " + y)
    My ground is at 71.5 (there's a half-slab / step)
    I dropped the items from a height of 100

    In most cases, the output looks something like this:
    100
    81.9264
    71.5
    71.5
    71.5

    But sometimes, this happens:
    100
    81.8203
    71.73333
    71.73333
    71.73333
    71.73333

    And although the item is (viewed from ingame) clearly on the ground, the location data seems to be stuck at a false height. Sometimes the Y-value is even more extreme and e.g. stuck 10 blocks above the ground, although the item IS (in real) on the ground!

    What did I make wrong or why doesn't the location update sometimes? :l

    - Cedi
     
Thread Status:
Not open for further replies.

Share This Page