Flint and Steel Problem

Discussion in 'Plugin Development' started by Skify, Feb 19, 2016.

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

    Skify

    Hello, I have this code where it's suppose to only be able to use a flint and steel 3 times. But after the 3rd time, the player still has the item, when they place it, it just disappears. I need help with making it only 3 time use and would be gone from the player's hand. I think that was wrong English. :)
    http://pastebin.com/tbwaR0Fb
     
  2. Offline

    MaTaMoR_

    You can try storing the an Integer using Reflections, then just check the Integer.
     
  3. Offline

    Rndom293

    You could make it so that the durability goes down a certain amount after every use, and on the final use, you get their inventory and take away the flint and steel.
     
  4. Offline

    Skify

    So every use, subtract 21.3 of durability if I wanted as 3 charges? Since I believe fns durability starts from 64.
     
  5. Offline

    Xerox262

    @Skify Or just listen for a player interact event, wait does it trigger block place event? Then remove the flint and steel if the durability is lower than 62
    .
     
  6. Offline

    DarkestCodes

    One way you could do it is storing a HashMap with all the uses of flint and steel, and prevent usage of it after the value of the key (the player UUID, name, or object) is over 3.
     
  7. Offline

    Rndom293

    Essentially, yes.
     
Thread Status:
Not open for further replies.

Share This Page