Solved .dropItem problem

Discussion in 'Plugin Development' started by Josh014, Dec 30, 2014.

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

    Josh014

    Hello,

    I'm spawning an item on a block but the item always goes to the very edge of the corner. I try to teleport it to the middle of the block but it still seems to spawn at the corner.

    Code:
    Code:
    Item item = world.dropItem(currentBlock.getLocation().add(0, 1, 0), dBlock);
                                    item.setVelocity(new Vector(0,0,0));
                                    item.teleport(currentBlock.getLocation().add(0.5, 0, 0.5));
    Thanks in advance,

    Nevermind fixed it :). Instead of adding the coordinates at the item.teleport(); Just add them when you spawn the item ;).

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 31, 2016
Thread Status:
Not open for further replies.

Share This Page