Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do I use setMetadata?

Comments in 'Plugin Development' started by hash, Aug 3, 2014.

  1. hash
    Offline

    hash New Member

    Joined:
    Aug 3, 2014
    Posts:
    2
    I am trying to add Metadata to a player, and when I try set it, I'm told "Argument 3 passed to pocketmine\metadata\MetadataStore::setMetadata() must be an instance of pocketmine\metadata\MetadataValue"

    So I can see I need to use pocketmine\metadata\MetadataValue, I'm just not 100% sure how and have been running round in circles trying to implement it properly. I already tried googling, looking at SimpleAuth which doesn't seem to implement it, and looking at the docs (which I don't really find that helpful, they are just generated from the src, but I can read that in the src anyway)

    Apologies for the low level question, I was following some video tutorials but it was very frustrating as the person creating the videos clearly didnt know much PHP, and they weren't explaining anything that was relevant. Thanks.
    PEMapModder likes this.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    hash likes this.
  3. hash
    Offline

    hash New Member

    Joined:
    Aug 3, 2014
    Posts:
    2
    I find its often the case, tutorials sometimes are done by people who are barely competent. I work with PHP elsewhere and have done for a few years, but I have never used OOP so I'm trying to get into that at the same time as pocketmine plugins, so just a few things are catching me out really.

    I'll leave it out for now then, no point relying on something that isn't stable. I'm just making an administration plugin, but I'll just store the data in a db of some sort
    PEMapModder likes this.

Share This Page

Advertisement