Hello! I am trying to create a method whereas every minute the player with the Atlatl kit selected is given 1 arrow and it caps off at 10, meaning once it hits 10, the player cant receive anymore. So far, this is all I have been able to figure out though.... Code:java Inventory Pinv = player.getInventory(); ItemStack Arrow = new ItemStack(Material.ARROW); for (ItemStack item : Pinv.getContents()){ if (item == null){ continue; } if (item.getType().equals(Material.ARROW)){ } }} }} Can anyone explain to me how to check for all that stuff? Thanks!
If there is only one player, then use an int and add one to it each time. If there are multiple people with the same kit, then use a hashmap with args player and integer. on Give or whatever you call it, if the number (for the player if its a hashmap) is == 10, then deny, else allow. The minute timer can be accomplished with the Bukkit scheduler, however, this can be tricky to understand at first. Is there only one instance of this happening at any given time? I can assist here as well, however, I need to know more about how this situation is occurring.