Outside of punishment appeals, these forums have been archived.
We hope to see you on our Discord instead!
Discord has a minimum age, found here. You may need to wait, or ask a parent to handle tickets for you.
Hey! Register here to create your account, engage with the community, and talk about what is new!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
execute code when a certain entity is right clicked.
How can I make it when a certain entity like a villager is right clicked it executes code but if a player right clicks a different villager it executes different code.
Hey! In order to do this, use the ClickEntity player event, and then use the if entity -> NameEquals, and then place a text inside the chest. After the piston (or bracket), place what you would like to happen.
In this example, the code runs like the following:
If name equals "NotBob" {
Send message to villager
}
If name equals "Bob" {
We decide to kick the player because Bob isn't nice
}
Hey! In order to do this, use the ClickEntity player event, and then use the if entity -> NameEquals, and then place a text inside the chest. After the piston (or bracket), place what you would like to happen.
In this example, the code runs like the following:
If name equals "NotBob" {
Send message to villager
}
If name equals "Bob" {
We decide to kick the player because Bob isn't nice
}