Solved reward armor

Discussion in 'Plugin Help/Development/Requests' started by King V, Jun 7, 2015.

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

    King V

    how can i make it, so you can open a "reward crate" then get a RANDOM reward from a selection of armor to hats i have made? and without getting the hat or armor from a crate you cant use it.
     
  2. Offline

    BizarrePlatinum

    @King V make an RNG that runs when a player right clicks the "crate", then you can have it give them an item that corresponds with that number. If you would like probability to be different for the items, you can give some items more than one number, and others less.
     
  3. Offline

    King V

    how can i save it so they can use it later after they take it off etc.. after restart too
     
  4. Offline

    8jy89hui

    @King V You have 2 options:

    1: Save all these items in a massive hashmap and ask to see if that player has the requested ItemStack when they try to put on armor.

    2: Use ItemStack.setMetadata() to say add the data "Wearable" then look for the "Wearable" meta when trying to put on an item

    This way only the crate armor will be wearable
     
  5. Offline

    King V

    1. how would i do that? example?
    2. i dont understamd ._.
     
  6. Offline

    I Al Istannen

  7. Offline

    King V

    So im trying to use a hash map =) but how can i do this with many different rewards? i dont want to make one for all of them -_-

    i found out on my own =P

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
Thread Status:
Not open for further replies.

Share This Page