Minecraft Java Edition – How to Check Bell’s Block Entity Data in Minecraft

minecraft-commandsminecraft-java-edition

[Minecraft 1.14.4]

I want to check when a player hits a village bell in minecraft, and then perform some action.

After reading a bit on the minecraft wiki, it seems that bells have a block Entity Data entry named "keepPacked" that should be set to 1 if the bell is swaying (has been hit) or 0 if it's stationary.

I'm not sure how to access this data, or if this is even possible.

Best Answer

You can create a scoreboard objective to detect when a player rings a bell, the command to create the scoreboard objective looks like this:

/scoreboard objectives add bell minecraft.custom:minecraft.bell_ring

The score for a player increases by one every time that player rings a bell.