/testfor values [duplicate]
In MCPE/Bedrock, the commands sort of appear as you type them, giving you options to choose from. I typed in /testfor @p[r=3,
and then, these appeared:
- C
- Dx
- Dy
- L
- Lm
- M
- Name
- R
- Rm
- Rx
- Rxm
- Ry
- Rym
- Type
- X
- Y
- Z
What do all these different values mean? I know about Type
and Name
, so you don't need to list those when answering this question.
Also, slightly off-topic but I am looking to create a testfor command that activates a comparator when there is a player with a certain item in their hand. Is there one of these tags that would help me do this?
-
x/y/z
- Change the starting point for area selections. They do nothing on their own, but change wherer
,rm
, anddx/dy/dz
start from. -
r
- The maximum radius around the starting point for entity selection. Only entities within the radius will be selected. -
rm
- The minimum radius. Only entities outside the minimum radius will be selected. -
dx/dy/dz
- Define a bounding box for entity selection. The box starts at the starting point, and extendsdx/dy/dz
+ 1 blocks in the respective directions. If any of them are negative, it instead extendsdx/dy/dz
- 1 blocks in that direction. If you use any of them, the ones you leave out are assumed to be0
. -
c
- The maximum count of entities that will be selected. The closest entities are chosen first. If you make this negative, it will select the furthest entities instead. -
l
- The maximum XP level of target players. -
lm
- The minimum XP level. -
m
- The gamemode of target players. -
rx/ry
- The maximum rotation of the target entity around the X and Y axes. -
rxm/rym
- The minimum rotation.
I am looking to create a testfor command that activates a comparator when there is a player with a certain item in their hand.
I don't think this can be done in BE. It would require access to player data, or a command that can check whether a slot contains a certain item, and BE has neither.