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

Hit by a snowball

Comments in 'Plugin Development' started by minebuilder0110, Oct 17, 2015.

  1. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Can someone tell me how to set certain data for a snowball which can be used to check later?
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    use $snowball->namedTag
    e.g.
    PHP:
    $snowball->namedtag->MyData = new String("MyData""dafdahfkiashfasiduashdia");
    PEMapModder likes this.
  3. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Thanks. But do I use getName to retrieve the data?
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    $snowball->namedtag["MyData"] will get you the string (not String object).

    Warning: The String class has been renamed to StringTag in PHP 7 support.
    Legoboy0215 likes this.

Share This Page

Advertisement