Reward after amount of blocks broken

Discussion in 'Plugin Development' started by Xyrde/legendcentral, Jan 2, 2017.

Thread Status:
Not open for further replies.
  1. I currently need help with this, after for example 100 blocks are broken with an specific pickaxe you get efficiency 1 on your pickaxe. I tried this:

    public void giveReward(Player p) {

    if (API.getShovelCount(p) == 20) {
    p.sendMessage("test");
    }
    }

    but that did not work
     
  2. Offline

    Zombie_Striker

    @Xyrde/legendcentral
    What does not work? How do you know?

    What is API? What is "API.getShovelCount"? Are you sure it is ever equal to 20? Are you sure giveReward is ever called?
     
  3. Offline

    timtower Administrator Administrator Moderator

  4. Offline

    GraveThief

    How about, everytime a block is broken on a certain pickaxe, you set it's lore and add +1 to and integer in the lore? But everytime a block is broken, check to see if it's reached a certain milestone and then if it has then execute that method.
     
  5. Alright, the API is my block counting method, and how do I call giveReward?
     
  6. Offline

    Lordloss

    Please follow the link in my signature.
     
  7. Offline

    GraveThief

    @Xyrde/legendcentral Here's an idea, use a block break event and check if the item in hand is a pickaxe type (getType()) and then use API.getShovelCount thing and then check if its got the right amount of blocks broken for the condition to be true and if so, giveReward(p);
    Simplez
     
Thread Status:
Not open for further replies.

Share This Page