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

Need help for spawn item on the floor when command is executed

Discussion in 'Help' started by Jules, May 14, 2018.

  1. Jules

    Jules Witch

    Messages:
    53
    GitHub:
    Julooooos
    I don't know what function I have to use to make item(s) spawning on the floor : at specific coords.
     
  2. Jules

    Jules Witch

    Messages:
    53
    GitHub:
    Julooooos
    can anyone help me ?
     
    Last edited: May 14, 2018
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
  4. Jules

    Jules Witch

    Messages:
    53
    GitHub:
    Julooooos
  5. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    Look carefully on the link above. :D It shows position too :D
     
  6. Jules

    Jules Witch

    Messages:
    53
    GitHub:
    Julooooos
    Is this code right ? @TheDeibo
    Sorry for my English, im French !
    PHP:
     public function onCommand(CommandSender $senderCommand $commandstring $label, array $args) : bool {

            if(
    $command->getName() === "guerilla") {
                
    $coords 'And then the coords'
                
    $this->getServer()->broadcastMessage("My message");
                
    $this->getLevel()->dropItem($coordsItem::get(Item::DIRT));
     
  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.