The bug
Sculk sensors do not detect rabbits eating planted carrots. This is unexpected, as this is a block change and as such should be considered a vibration and be detected by sculk sensors.
To reproduce
/fill ~ ~ ~ ~10 ~ ~10 minecraft:farmland[moisture=7]/fill ~ ~1 ~ ~10 ~1 ~10 minecraft:carrots[age=7]Place a sculk sensor nearby.
/summon rabbit ~ ~ ~Wait for the rabbit to eat the carrots.
Expected result
The sculk sensor would pick up the vibration.
Code analysis
Code analysis by @unknown can be found in this comment.
Attachments
Comments 8
Can confirm in 1.19.2. Just for clarification reasons, sculk sensors are activated upon the player feeding carrots to rabbits directly but are not activated when rabbits eat carrots from raiding gardens. It would probably be worth mentioning this somewhere within the report to clear up any potential confusion.
I can confirm this behavior. 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.entity.Rabbit.java
If we look at the above class, we can see that rabbits eating carrots as a result of raiding gardens 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" or "EAT" game event tag would be expected to be used here.