Detecting if item is tool and then tool type

Discussion in 'Bukkit Help' started by martijnpold, Sep 12, 2015.

Thread Status:
Not open for further replies.
  1. I'm trying to find a way to detect if a player is using a tool or not and if they do what material the tool is made of. For instance I would want to detect when someone is using a shovel and if so if it is a Iron or Diamond shovel.

    How would i do this?
     
  2. Offline

    oceantheskatr

    If you're talking about Bukkit coding, then on BlockBreakEvent you should get the material in the player's hand, and then use a switch statement to do stuff based on which material it is :)
     
  3. I need it to return stuff like: Wooden, Iron, Diamond etc.
     
  4. Offline

    Binner_Done

  5. Offline

    oceantheskatr

    Actually I will lol xP I auto-watch every thread I comment on! :p

    But yes, @martijnpold Make sure to tag people usually so that they see it.

    Here, I wrote out an example for you, make sure to read the comments I've put on it for you to understand it better if you don't :)
    http://pastebin.com/1EZk71Fv
     
Thread Status:
Not open for further replies.

Share This Page