Block break normal duration.

Discussion in 'Plugin Development' started by xDrapor, Oct 20, 2012.

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

    xDrapor

    Alright, so I have been down the path of manually entering block hardness values, by referencing them from the wiki.

    Code:
    public double getBlockBreakTime(Player player, Block block){
            double baseTime = getBlockHardness(block) * 1.5;
            if(player.getItemInHand().getType() == Material.DIAMOND_AXE){
               
            }
            return baseTime;
        }
    That was what I began working with, however, instead of doing checks for multiple blocks, and tools, there has to be a better method to get the normal time to break a block, considering the tool held. Remember, I'd have to consider enchantments such as efficiency, how long tools destroy blocks they weren't designed to break take to break that block. Recording values with a "logging" plugin might work, but that again, is not efficient.

    Any input is appreciated.

    P.S: This is for dev.bukkit.org/server-mods/safeguard.

    Bump, been awhile with no replies, anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
Thread Status:
Not open for further replies.

Share This Page