The Bug
A sound (or empty sound event) should probably also be implemented for this. Would this not fall under a "block change"?
Steps to Reproduce
Place down a redstone repeater and a sculk sensor nearby.
Change the delay on the redstone repeater by right-clicking it.
As you do this, take note as to whether or not sculk sensors are activated upon using switching the delay on redstone repeaters.
Observed Behavior
Sculk sensors are not activated upon using switching the delay on redstone repeaters.
Expected Behavior
Sculk sensors would be activated upon using switching the delay on redstone repeaters.
Code Analysis
Code analysis by @unknown can be found in this comment.
Linked issues
Attachments
Comments 19
Can confirm in 22w18a. Here's a code analysis regarding this issue.
Code Analysis:
The following is based on a decompiled version of Minecraft 1.18.2 using MCP-Reborn.
net.minecraft.world.level.block.RepeaterBlock.java
public class RepeaterBlock extends DiodeBlock {
...
public InteractionResult use(BlockState $bs, Level $l, BlockPos $bp, Player $p, InteractionHand $ih, BlockHitResult $bhr) {
if (!$p.getAbilities().mayBuild) {
return InteractionResult.PASS;
} else {
$l.setBlock($bp, $bs.cycle(DELAY), 3);
return InteractionResult.sidedSuccess($l.isClientSide);
}
}
...
If we look at the above class, we can see that switching the delay on repeaters simply isn't registered as a game event as the gameEvent()
method is never called, thus not detecting this action as a vibration.
Potential Fix:
Simply calling the gameEvent()
method where appropriate within this piece of code should resolve this problem. The "BLOCK_CHANGE" game event tag would be expected to be used here as the "delay" block states of repeaters are changed. The following line of code could be used in order to fix this:
$LEVEL.gameEvent($PLAYER, GameEvent.BLOCK_CHANGE, $BLOCKPOS);
Can confirm