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

the item dont drop !! heelp !!

Comments in 'Plugin Development' started by XWITHERHEROX, Dec 28, 2015.

  1. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    help what the problim is this !?
    the item not drop



    PHP:
        public function onDamage(EntityDamageEvent $ev){
    if(
    $ev instanceof EntityDamageByChildEntityEvent){
    $ev->getEntity()->getLevel()->addSound(new GhastShootSound($ev->getEntity()->getLocation()));

    $level $ev->getDamager()->getLevel();
    $level->addSound(new BlazeShootSound($ev->getDamager()->getLocation()));
    $ev->getDamager()->sendTip(TextFormat::RED."HOT SHOOT!");
    $level->dropItem(new Position($ev->getDamager()->x$ev->getDamager()->y$ev->getDamager()->z), Item::get(262,1,1));
    }
    }
    :confused:
  2. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
  3. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    no error
    only the item not droped
    the tip come to me and the sound
    but !
    the item no ! :(
  4. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    The item drops directly to the damager, you should check your inventory if the item is already added to your inventory!
  5. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    no hes not added !!
  6. Adversarius
    Offline

    Adversarius New Member

    Joined:
    Oct 4, 2015
    Posts:
    16
    Minecraft User:
    Adversarius
    I think you can use this instead, that the Player die and you got the Items:

    $event->getPlayer()->getInventory()->addItem(Item::get(369, 0, 1));
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This probably won't occur any soon, but imagine, if a skeleton shoots an arrow, you are trying to sendTip() on a skeleton.
  8. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    $ev->getDamager() will be instanceof Position, so you can just do
    PHP:
    $level->dropItem($ev->getDamager(), Item::get(262,1,1));
  9. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
  10. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    It works for me, what version of pocketmine are you using?

Share This Page

Advertisement