I was trying to create a way so when someone stands on an iron pressure plate, it says hello to them in chat.
The command is:
Command block 1:
testfor -87.643 65 -67.535 heavy_weighted_pressure_plateCommand block 2:
say WelcomeBut when I stood on the pressure plate nothing happened
It says:
1[18:16:21] Entity '-87.442' cannot be found
1 Answer
/testfor is for entities only. If you want to check a block instead, use /testforblock.
It looks like you've copied the coordinates from your exact feet position. These may not end up rounding correctly to a block position; I'd recommend using the Looking At values instead:
The following command will test for a heavy weighted pressure plate at (-88,65,-68), regardless of its power level:
/testforblock -88 65 -68 heavy_weighted_pressure_plateYou can then test for a specific power level with blockstates like this:
/testforblock -88 65 -68 heavy_weighted_pressure_plate power=1 3