Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Drop Entity In World

Comments in 'Plugin Development' started by elfin8er, Mar 23, 2014.

  1. elfin8er
    Offline

    elfin8er New Member

    Joined:
    Feb 1, 2014
    Posts:
    25
    Minecraft User:
    elfin8er
    I'm trying to drop an item in the World. Similar to Bukkit's dropItemNaturally. I'm pretty sure I have to do
    Code:
    $this->api->entity->drop(new Position($x, $y, $z));
    However, this function also requires an Item. How would I make this? Can I get the item from a $data variable in my event?
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    PHP:
    $item $this->api->block->getItem($id$meta$amount);
    elfin8er likes this.
  3. elfin8er
    Offline

    elfin8er New Member

    Joined:
    Feb 1, 2014
    Posts:
    25
    Minecraft User:
    elfin8er
    Is $id, $meta, and $amount integers?
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Yeah, they are all integers, and the function only requires $id
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Calling in static manner is better.
    elfin8er likes this.

Share This Page

Advertisement