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

AddItemPacket

Discussion in 'Development' started by chansol, Jul 15, 2017.

  1. chansol

    chansol Spider Jockey

    Messages:
    32
    GitHub:
    ParkChanSol
    public function spawnTo(Player $p) {
    $pk = new AddItemEntityPacket();
    $pk->x = $this->x + 0.5;
    $pk->y = $this->y + 1;
    $pk->z = $this->z + 0.5;
    $pk->entityRuntimeId = $this->eid;
    $pk->item = $this->item;
    $p->dataPacket ( $pk );
    }



    I test on PocketMine-MP API 3.0.0-ALPHA7.
    I make itemcase, and after time passes always disappear itemcase.
    How to fix?
     
  2. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    PLEASE use [ php ] we can't very be helpful if you don't use that.Thanks[/php]
     
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    actually we can
    there's nothing hard to read,
    it's just sometimes we want excuses to not be helpful

    i think you need to resend it every so often to prevent it disappearing
     
    XdmingXD likes this.
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Should be $this->id. Anyway, describe "disappear"
     
  5. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    do you mean the item despawns?
     
    R4EVAELRM likes this.
  6. R4EVAELRM

    R4EVAELRM Witch

    Messages:
    73
    most likely it despawns because how the client handles DroppedItems so you probably have to resend every 5 mins but that might cause lag.
     
  7. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Made sure you aren't using any entity clearing plugins?
     
  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.