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

Solved Drop all items

Discussion in 'Development' started by aTmG, Jul 28, 2018.

  1. aTmG

    aTmG Silverfish

    Messages:
    22
    GitHub:
    ATMG
    How can I make a player drop all items the same way as when they die?
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    $level->dropItem($pos, $item, $motion);
    Maybe set motion to zero
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Call:
    PHP:
    /** @var Inventory $inventory */
    /** @var Vector3 $pos */
    $inventory->dropContents($pos);
    On player's inventory, cursor inventory and armor inventory.
     
    OnTheVerge and RumDaDuMCPE like this.
  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.