Allow forcing break effects when using breakNaturally (#12734)

This commit is contained in:
Fisher
2025-07-18 16:17:38 -04:00
committed by GitHub
parent 0dad7f150b
commit 782ce950b8
2 changed files with 25 additions and 7 deletions

View File

@@ -591,6 +591,18 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
*/
boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience);
/**
* Breaks the block and spawns item drops as if a player had broken it
* with a specific tool
*
* @param tool The tool or item in hand used for digging
* @param triggerEffect Play the block break particle effect and sound
* @param dropExperience drop exp if the block normally does so
* @param forceEffect Forces the break effect to be triggered even if the tool is not the correct tool for the block
* @return true if the block was destroyed
*/
boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience, boolean forceEffect);
/**
* Causes the block to be ticked, this is different from {@link Block#randomTick()},
* in that it is usually scheduled to occur, for example