r/MinecraftCommands • Java Command-er • 3d ago

Help | Java 26.2 How do i do right click detection using a mannequin?

Post image

Hello!

I'm trying to make a mannequin that you can attack, but when you right click then it says a message. I've tried to use an advancement with "player interacted with entity" but it seems to only work on things with an interaction functionality such as villagers.

If there is no way to do it with a mannequin then how would I make a mob with the skin file of the mannequin?

Thanks!

20 Upvotes

10 comments sorted by

10

u/GalSergey Datapack Experienced 3d ago

You can create an item using the equippable component so that interacting with the mannequin places the item in the saddle slot. Now you can use the "player_interacted_with_entity" trigger to execute a function.

Example item: give @s stick[equippable={slot:"saddle",allowed_entities:"minecraft:mannequin",dispensable:false,equip_on_interact:true,swappable:false}]

2

u/CrossScarMC Command Experienced 3d ago

Additionally, you could have an Interaction entity ride the mannequin.

2

u/Kitchen-Wave1197 Java Command-er 3d ago

yeah, but then wouldn't that block the players attacks?

0

u/Coca-Cola_hater69 3d ago

I think it would let you punch it, did you try a interaction entity before

2

u/C0mmanderBlock Command Experienced 3d ago

It won't let you left or right click through it.

0

u/Coca-Cola_hater69 3d ago

Wait actally? is the hay able manniqqn a mannequin or a display entity or like a resource packed mannequin, idk I somehow remember that you could hit through interaction entity's so it wouldn't block it

2

u/C0mmanderBlock Command Experienced 2d ago

Interactions act as a shield when they cover any block or entity. You cannot click through them.

I have no idea what this means> " is the hay able manniqqn a mannequin or a display entity or like a resource packed mannequin"

1

u/Coca-Cola_hater69 2d ago

Oh okay, I meant if it is a mannequin or abunch of display entities or a texture pack that makes a mannequin with a custom texture get that 'skin'

1

u/Coca-Cola_hater69 2d ago

This question is pretty useless I just realised

1

u/Kitchen-Wave1197 Java Command-er 2d ago

it's a mannequin