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

MobEquipmentPacket not working

Discussion in 'Help' started by MinekCz, Apr 10, 2021.

  1. MinekCz

    MinekCz Spider Jockey

    Messages:
    29
    Hi!
    Before PocketMine update I had little Minigame where are some items... When you have certain item selected, then it changes your XP bar to some value. I used MobEquipmentPacket.

    But, this update make this method unusable.

    Here is my code and error:


    Edit: The only way that I found is to change from Private to Public $itemStack in ItemStackWrapper...
    I would just be interested if there is any other way than editing source
     

    Attached Files:

    Last edited: Apr 10, 2021
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    You can use $packet->item->getItemStack()
    Though you should really use PlayerItemHeldEvent instead of that, you wont need to care about changes in the protocol
     
  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.