r/MinecraftCommands • Command Block Noob HELPPP • 16d ago

Help | Java 26.3 use a cushion to set off a command?

heya, im trying to make a command block go off and trigger another one when a player sits on a cushion, but im having trouble figuring out how to get the command block to pay attention to the cushion, never mind to recognize when its in use. my best guess so far was

/execute if block 170 93 179 #minecraft:cushion_uses_collision_shape

but being on the block and using the cushion both dont trigger the command. beyond that, i have no idea what uses_collision_shape is (both sitting and breaking it failed to do anything), but i cant find anything else with "cushion" in it, because it's an entity, not a block.

i cant get this command block to give off so much as a signal. if you have any ideas, please help!

4 Upvotes

6 comments sorted by

3

u/GalSergey Datapack Experienced 16d ago

The pillow is an entity, not a block, so checking the block tag won't help you in any way. If you want to check that the player is sitting on any cushion, then you can use something like this predicate:

execute as @a if predicate {type:"minecraft:entity_properties",entity:"this",predicate:{"minecraft:vehicle":{"minecraft:entity_type":"minecraft:cushion"}}} run say Example command.

1

u/Basic-Ad954 Command Block Noob HELPPP 15d ago edited 14d ago

oh cool, ok! any way i can focus it on a specific cushion?

1

u/GalSergey Datapack Experienced 15d ago

You can add a tag check to the predicate, for example:

execute as @a if predicate {type:"minecraft:entity_properties",entity:"this",predicate:{"minecraft:vehicle":{"minecraft:entity_type":"minecraft:cushion","minecraft:entity_tags":{any_of:["custom_cushion"]}}}} run say Example command.

1

u/Basic-Ad954 Command Block Noob HELPPP 14d ago

ive figured out why i couldnt get this to work- i just saw your datapack flair. im using command blocks. i was at it for HOURS before I noticed. i'll see if i can add co-ordinates to the first command to see if that'll do it. and i'll make myself a command block flair or i'll keep forgetting to mention it lol

1

u/Sma11ButHappy best Minecraft Bedrock commander! 16d ago

a cushion is an entity you could maybe do that. im not to the best at java commands.

1

u/Basic-Ad954 Command Block Noob HELPPP 15d ago

unfortunately not, i already looked at the entity tag lol. its all like "nearest entity," "all players," etc.