CraftTweaker

CraftTweaker

151M Downloads

Simulate block breaking for use with events.

ChiefLogan3010 opened this issue ยท 0 comments

commented

Describe the feature you'd like

I'd like for there to be a way of simulating block breaking with CT so that the breaking animation and particles are used. I imagine this would fall under Level looking something like:

level.breakBlock(pos as BlockPos, miningSpeed as Int, toolAction as String, doDrops as boolean);

//the below will break the block at blockPos with an axe of mining speed 8 (diamond tier)
level.breakBlock(blockPos, 8, "axe", true);

I'm unsure if this would suit better as an expansion of .destroyBlock since that works instantly, and would likely cause issues for any scripts already using it.

Describe alternatives you've considered

Can use sequences to somewhat simulate this, letting the world tick for x ticks before using .destroyBlock or .setBlockAndUpdate, but this does not indicate anything to the player while the breaking is happening, such as the block particles or breaking animation.

Additional context

Requested version is 1.19.2, but that's not shown in the list below.

Minecraft version

1.19

Modloader

Forge