Player entity MetaData

Discussion in 'Plugin Development' started by bennie3211, Dec 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    bennie3211

    Hello bukkit,

    I've a question about the use of metadata for a player entity. I'm trying to give a certain player metadata, but I can't get it working.

    This is what I've tried:

    Code:
    pl.setMetadata("Jumper_time", new FixedMetadataValue(plugin, System.currentTimeMillis()));
    //System.out.println("Time: " + pl.getMetadata("Jumper_Time").get(0).asLong());
    System.out.println(pl.getMetadata("Jumper_Time"));
    The code runs, but the list is empty. That's why I got a outOfRange error when I tried to get the first value from the list. Can someone tell me how this should work?
     
  2. Offline

    Webbeh

    Maybe by checking "Jumper_time" instead of "Jumper_Time" ?
     
    bennie3211 likes this.
  3. Offline

    Rocoty

    This is why we use constants...
     
    bennie3211 and teej107 like this.
  4. Offline

    bennie3211

    thnx, didn't read it good enough, and yes I will use constants from now for this xD
     
Thread Status:
Not open for further replies.

Share This Page