Methods And Events
Methods
All the methods available to you are found in the BreakPlayer class, so you'll always need to get the BreakPlayer before accessing any methods.
To do so, you'll need to:
Get an instance of the main class (plugin) from the server plugin manager. Get the breakRegistry using the method in the main class
Use the getBreakPlayerRegistry method to get the breakPlayerRegistry
Use method breakPlayerRegistry#getBreakPlayer(Player player) to get a break player from a bukkit player. This method returns an Optional<BreakPlayer>.
Now that you know how to get a BreakPlayer, you can use the methods:
BreakPlayer#startMining(Block block, double secondsBlockShouldTakeToBreak, boolean dropVanillaBlock);
BreakPlayer#stopMiningAndResetAnimation();
Example:
Events
BlockHardnessBlockInteractEvent (has everything that a block break event has).
CustomHardnessBlockBreakEvent (has everything that a block break event has).
Last updated