Setting Names with a valid VariableDeclaratorId

Discussion in 'Plugin Development' started by DeadlyScone, Dec 3, 2011.

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

    DeadlyScone

    so from my other thread i posted, i figured i could use a TreeSet, although one problem still persists...
    I need to set the name of the treeset as the players name that raised the event, in this case EntityDeathEvent. Any help would be greatly appreciated :D

    EXAMPLE: onEntityDeath()
    TreeSet ((Player)entity).getName = new TreeSet
    to get an ouput of
    TreeSet DeadlyScone = new TreeSet
     
  2. I don't think java supports dynamic variables (I don't know if thats the proper name for them). Java doesn't support variable creation during run which is what your trying to do. I'm not an expert but I tried to do this before and found a link on google that says this can't be done in Java.
     
  3. Offline

    DeadlyScone

    hmm, that is a bummer :/ oh well, thanks for your reply anyway.
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    you an sorta work around this, but storing a treeset in a hashmap with a key for you player. So you can construct one anonymously, and call it back by key.
     
  5. Offline

    DeadlyScone

    didn't think about that. thanks
     
Thread Status:
Not open for further replies.

Share This Page