How to use Interaction Entities in Minecraft

Ойындар

A quick tutorial on how to use interaction entities using both command blocks and datapacks.
Command Blocks:
execute as @e[type=interaction] on attacker run say left
execute as @e[type=interaction] on target run say right
bonus
execute as @e[type=interaction] if data entity @s attack run say I was left clicked
execute as @e[type=interaction] if data entity @s interaction run say I was right clicked
execute as @e[type=interaction] run data remove entity @s attack
execute as @e[type=interaction] run data remove entity @s interaction
Latest Version (1.19.4)
📦 Download: www.dropbox.com/s/9xx1t6pt8pg...
🔵 Discord & Other Links: linktr.ee/CloudWolfMC
💻 Website: cloudwolfyt.github.io

Пікірлер: 67

  • @ignWally
    @ignWally Жыл бұрын

    This will be actually incredible for creating minigames in minecraft, considering the size of it can be fully customized. Great addition to 1.20!

  • @trashcaster

    @trashcaster

    Жыл бұрын

    It's actually 1.19.4, so even sooner than 1.20 people can use it

  • @ignWally

    @ignWally

    Жыл бұрын

    @@trashcaster well thats fantastic

  • @SozoKa
    @SozoKa Жыл бұрын

    To get the entity that got clicked in command block, you can do : execute as @e[type=minecraft:interaction,distance=..6] at @s on attacker as @e[type=minecraft:interaction,distance=...1] run ...

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    Yeah u can do it by moving positioning around but I prefer the method with less @e selectors especially since u can optionally maintain the player and the entity’s location and selection at all times

  • @SozoKa

    @SozoKa

    Жыл бұрын

    ​@@Cl0udWolf Of course ^^ It's just the shortest way with the command blocks 👍🏻

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    @@SozoKa sort of, tho with command blocks u can just do execute as @e[type=interactor] if data entity @s attack run ...

  • @SozoKa

    @SozoKa

    Жыл бұрын

    @@Cl0udWolf bruh 😭😂

  • @captaincomic8678
    @captaincomic8678 Жыл бұрын

    I'm personally planning to use this in an adventure map I'm working on where I have stuff like force field generators to smash and multi-button control consoles to interact with, this is all very exciting stuff.

  • @The_Munch
    @The_Munch Жыл бұрын

    You're a legend, thanks for all these useful video's

  • @Njb-yp4td
    @Njb-yp4td Жыл бұрын

    This makes a lot of sense. Thank you!

  • @gamingkanal7672
    @gamingkanal76726 ай бұрын

    Thanks for your contribution. I think it is very helpful for my inspiration when coding things in MC

  • @AiRsTrIkExXzZ
    @AiRsTrIkExXzZ Жыл бұрын

    I’m using this for my tardis. I’m on my 8th iteration with this one going to be the most advanced since the vanity of the tardis will look spectacular with item frames with maps and making survival friendly. I’m using this for the door function where it’ll detect if the player who is trying to open the door has a tardis key before opening the door if they have a key

  • @RoarkCats
    @RoarkCats Жыл бұрын

    5:40 Found a good use of the new return command here! Instead of having all subsequent commands run from an if statement or making a whole new function for them, you can just say the following and then all code thereafter can run freely as the clicked interaction _execute if score __#bool__ test matches 0 run return 0_

  • @Bansed
    @Bansed Жыл бұрын

    the command block placing is mad sus

  • @SozoKa

    @SozoKa

    Жыл бұрын

    🤨

  • @Loggog

    @Loggog

    Жыл бұрын

    Nah bro you're just weird

  • @TheKnewGreg
    @TheKnewGreg8 күн бұрын

    Just a heads-up, you're able to completely skip searching for which interaction entity was interacted with by using a predicate. use "entity properties" and check that the nbt is equal to "{interaction:{}}" for right clicks and "{attack:{}}" for left clicks. Then, in the code that runs after getting the advancement, start it with "execute at @s as @n[type=minecraft:interaction,predicate={name of your predicate}] run tag @s add interaction" Now, you will only need to check the entity that has the tag "interaction" and it will be the one you interacted with (Just make sure to remove the tag at the end of the function)

  • @fullwoodenshovelfromminecr2365

    @fullwoodenshovelfromminecr2365

    6 күн бұрын

    crazy that we're both in the comment section of a video a year old at roughly the same time lmao i dont fully understand what youre saying here though. what would the code be in the predicate?

  • @TheKnewGreg

    @TheKnewGreg

    6 күн бұрын

    @@fullwoodenshovelfromminecr2365 I recommend using Misode's predicate generator. It shows you all the things you can do in a predicate. For this one, you need to set the predicate to "entity properties" (it should be this by default, otherwise it's the drop-down next to "single"). One of the text boxes under it will be for nbt, and that's where you need to put {interaction{}}. Basically, this will make the predicate true as long as the interaction entity has any interaction data at all. Just make sure the function that checks for this also runs a data remove command to delete the interaction data

  • @maarcislv
    @maarcislv Жыл бұрын

    Got to start playing MC again, this might be usefull in combination with display items for in-game shop rooms

  • @SnowyRedstone
    @SnowyRedstone Жыл бұрын

    also, I personally would use scoreboards for this one where in tick function I would save the attack/interaction into a scoreboard, and when no one touches it, it is blank, after attack/interaction, the scoreboard value will go to 1

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    that seems both less efficient and more complicated

  • @SnowyRedstone

    @SnowyRedstone

    Жыл бұрын

    @@Cl0udWolf I guess since it is just like how you would use carrot on a stick for click detection except the score is in the interaction entity and not the player but I wish they can just add click detection that's something like this: /execute as @a if entity @s click right run ...

  • @nobledame7110
    @nobledame7110 Жыл бұрын

    Noice

  • @Rusink
    @Rusink Жыл бұрын

    Genius :)

  • @oflashiii
    @oflashiii9 ай бұрын

    Hey CloudWolf , im wondering if theres an easy toggle for something like this (like im left clicking once and it shows an message and left clicking again it will delete the message) , do i need to make this with an scorebaord or is there an other better way? And can i define the player (without the advancement) that clicked the interaction and tp it to somewhere?

  • @foxlyticalxd2562
    @foxlyticalxd2562 Жыл бұрын

    Can we also add tags to these hitboxes so that way when we have multiple, we can tell the command to remove data of the hitboxes with only that tag?

  • @wassimtahraoui9888

    @wassimtahraoui9888

    6 ай бұрын

    they are still entities, so yes of course we can add tags to them

  • @commanderweeb9949
    @commanderweeb99492 ай бұрын

    Perhaps using this in conjunction with the bypass would allow for 20Hz left click detection?

  • @reallightengineer
    @reallightengineer2 ай бұрын

    is there a way to do it on entities such as frogs

  • @ivoknoob_2909
    @ivoknoob_290910 ай бұрын

    Imagine you have three of this interaction entities, how i can make them do different commands? Like first one to run say comand, second one to run playsound and etc.

  • @Cl0udWolf

    @Cl0udWolf

    10 ай бұрын

    Use tags

  • @prismsmoviecavern
    @prismsmoviecavern Жыл бұрын

    Hey can you please do a tutorial explaining and teaching us how to use the block interaction entities? Lots of cool values but what do they all mean

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    This is interaction entity

  • @themissinglink2481

    @themissinglink2481

    Жыл бұрын

    @@Cl0udWolf Interestingly if you have the interaction width to 100 and height to 100 it wont detect right click to that range.

  • @onlylvic

    @onlylvic

    6 ай бұрын

    ​@@Cl0udWolf but he's saying about block display I think

  • @wolfoxcs
    @wolfoxcs Жыл бұрын

    1.19.4 is live!! ^^

  • @mihaluich
    @mihaluich5 ай бұрын

    Hi, can I translate your video for my auditory

  • @calvinwithun6512
    @calvinwithun651210 ай бұрын

    I am trying to find a way to give a player special powers while wearing different trims... this feels like the way to go, but it's tricky because the entity blocks you from attacking or interacting with anything behind it. So, you can't have it floating in front of you at all times. I could put it at the very end of your reach, so you can interact with things between you and it, but then you wouldn't be able to use these powers in tight spaces... hmm...

  • @Cl0udWolf

    @Cl0udWolf

    10 ай бұрын

    use like clickable items or sneaking or something

  • @calvinwithun6512

    @calvinwithun6512

    10 ай бұрын

    @CloudWolfMinecraft yeah, maybe, but I'm trying to get it to work without gating it behind holding items. Sorta breaks immersion. I might make these powers only work if you have an empty hand. That way it won't interfere with shooting a bow or swinging a sword, but you can attack and interact with this entity floating on top of your head any time you're not holding anything. And if you want to mine dirt and don't have a shovel, just mine it with more dirt, or your pickaxe or something. Idk, I'm still brainstorming this. I think it can work, I just gotta be clever about it!

  • @geohype1099
    @geohype10995 ай бұрын

    the interaction entity is just not working at all, for me the commands do not work and clicking on the interaction entity doesn't do anything. Even with the chain command blocks the interaction entity does not work. Do you know what to do?

  • @antekacki8753
    @antekacki8753 Жыл бұрын

    What causes the interaction entity to not be viable on a per-tick basis? Does it have some sort of cooldown?

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    same as with carrot on a stick, it is rate limited to 5Hz unless u spam click it with ur mouse, then it can be up to 20Hz but that is even worse behavior to me

  • @antekacki8753

    @antekacki8753

    Жыл бұрын

    @@Cl0udWolf oh, so the problem is with continuously holding the button?

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    @@antekacki8753 yes but i would argue having inconsistent is worse than if it were consistently slow for most cases. also it blocks all other interactions both left and right i made a separate video explaining why it is not a good click detection method for most cases

  • @As1anCr4ck3r
    @As1anCr4ck3r Жыл бұрын

    Question, rn I am making a kit pvp thing and I want to be able to detect when a player left clicks while still being able to attack other players

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    cant with this or any method

  • @As1anCr4ck3r

    @As1anCr4ck3r

    Жыл бұрын

    @@Cl0udWolf oh ok, dang it why can’t they just add a left click and right click scoreboard objective

  • @wolfoxcs
    @wolfoxcs Жыл бұрын

    Hi Cloud Wolf. I want to get a player with the same name as an armour stand's name. Is it possible to do that?

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    it could be possible but it would be not very efficient and finding a better way to accomplish a similar task would be ideal

  • @benjaminnicro8775
    @benjaminnicro8775 Жыл бұрын

    Hi, is there any way to specify which interaction I'm attacking? for example by putting "type":"minecraft:interaction", [tag]

  • @Sakupenny

    @Sakupenny

    Жыл бұрын

    yes

  • @benjaminnicro8775

    @benjaminnicro8775

    Жыл бұрын

    @@Sakupenny how?

  • @Sakupenny

    @Sakupenny

    Жыл бұрын

    @@benjaminnicro8775 just summon a interaction with a tag then put @e[type=interaction, tag=the tag you added to the interaction]

  • @TYRCGC
    @TYRCGC Жыл бұрын

    Does this work on bedrock on nintendo switch

  • @bloosix
    @bloosix Жыл бұрын

    So i have a situation where I have two interaction entites, and when i hold a specific item in my offhand and right click something happens, but I only want it to work with one interaction entity, how would I do that?

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    U can’t. Interaction entities r hierarchical and cannot be ignored. The closest to the player while being in reach and clicked on will trigger

  • @bloosix

    @bloosix

    Жыл бұрын

    @@Cl0udWolf so then could i make it so that if others interact with it, nothing happens? Like if the don't have a certain tag when they click on it nothing happens

  • @Cl0udWolf

    @Cl0udWolf

    Жыл бұрын

    @@bloosix no. i made a separate video explaining why the interaction entity is not a click detection entity

  • @bloosix

    @bloosix

    Жыл бұрын

    @@Cl0udWolf Alr, thank you. You've been very helpful so i appreciate it

  • @gground9702
    @gground9702 Жыл бұрын

    bro made a pen** 💀

  • @ethanellis4042

    @ethanellis4042

    6 ай бұрын

    bruh

  • @SnowyRedstone
    @SnowyRedstone Жыл бұрын

    ayo that command block shape kinda sus

  • @smallfry7304

    @smallfry7304

    Жыл бұрын

    bro said sus

  • @ChillsTars8
    @ChillsTars8 Жыл бұрын

    I bet they are not adding this to bedrock😢

Келесі