onPlayerDropItem - wait till item hits/nears the floor?

Discussion in 'Plugin Development' started by chronopolis, May 20, 2011.

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

    chronopolis

    Hey guys - I use the onPlayerDropItem event and the item is eventually removed and a mob is spawned in the items location. My problem is waiting until the item is finished dropping to do all this (it looks better this way). Right now I use a separate thread that sleeps for a bit, obviously I would like to go away from using that.

    Any ideas?
     
  2. Offline

    bennyty

    I also need this.
     
  3. Offline

    DreadKyller

    the suggestion that was made on a few other threads of this exact same subject was to make a scheduler that would constantly get the items velocity and when it reaches 0 get it's position.
     
  4. Offline

    fullwall

    Use a scheduled task.
     
  5. Offline

    DreadKyller

    @fullwall yes, but that only thing I'm looking for as well is what to do in the scheduler? how do I check if there are enemies? do I use the block.getEntities()? If so this will not work for his purpose, because he wants to get the item itself, and it could land anywhere
     
  6. Offline

    fullwall

    Pass the Item Entity to the scheduled task. Work on the entity in the task.
     
Thread Status:
Not open for further replies.

Share This Page