Help w xray detector

Discussion in 'Spigot Plugin Development' started by Known, May 27, 2017.

  1. How would i check if a block has never been mined before, and how would i broadcast the amount of diamonds found
     
  2. You would have to track this data, either in flatfile or MySQL for each player. You can't gather this data from back in time, but you can moving forwards by listening for block break events and pickup item events.
     
  3. To broadcast the amount of diamonds just add the player and 1 to a hashmap. Add 1 to the hashmap everytime they mine a diamond, and Bukkit#getWorld()#broadcastMessage(Player mined HashMap#get(key) diamonds!");

    The amount of diamonds mined by each player will reset every time server goes offline ^