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
}