1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

DropItem

Discussion in 'Development' started by fevio, Mar 6, 2020.

  1. fevio

    fevio Spider Jockey

    Messages:
    33
    It's possible drop item in a specific coordinate(with chunckloaded ) ?

    I have tried $level->dropItem($pos ,$item) ; with $pos (object vector3) and $ item and $item but cause crash.

    advice?
     
    ethaniccc likes this.
  2. ethaniccc

    ethaniccc Baby Zombie

    Messages:
    189
    GitHub:
    ethaniccc
    I'm not sure how I can help you, since I'm not that advanced, but giving the crash log (the error) will allow others to help you :)
     
  3. fevio

    fevio Spider Jockey

    Messages:
    33
    "Undefined variable $pos " is the error
    The varriable pos is defined how vector3 and is valid i think because i have used $pos in $player->Teleport($pos) and was valid .... teleported the player
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Maybe you have a typo in your variable declaration. Please send the whole function you are using
     
    GamakCZ likes this.
  5. fevio

    fevio Spider Jockey

    Messages:
    33
    The problem is that when i do $level->dropItem($pos ,$item) in the $pos i add $player variable how is required from pocketmine the method works but drop the item from the player and not in a specific coordinates
     
  6. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Can you rephrase that? I have no clue what you mean
     
  7. ethaniccc

    ethaniccc Baby Zombie

    Messages:
    189
    GitHub:
    ethaniccc
    Can you show the error log, and your code?
     
  8. fevio

    fevio Spider Jockey

    Messages:
    33
    I have fix !
     
  9. fevio

    fevio Spider Jockey

    Messages:
    33
    $level->dropItem($player,$item) drop item from the player .
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.