click on interaction entity

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

hatt

Member
Oct 1, 2021
3
0
1
24
I want to use 'on click' event when I clicked interaction entity added in 1.19.4
But I got continuous error when I use 'on right click on interaction:' or 'on right click on interaction entity:' on my code.
Also I tried to give scoreboard tag to the interaction entity, and I use 'event-entity has scoreboard tag ...' but still not working.
How can I fix this? Aren't there expressions deal with interaction entity yet? Or any addon recommended?
 
I want to use 'on click' event when I clicked interaction entity added in 1.19.4
But I got continuous error when I use 'on right click on interaction:' or 'on right click on interaction entity:' on my code.
Also I tried to give scoreboard tag to the interaction entity, and I use 'event-entity has scoreboard tag ...' but still not working.
How can I fix this? Aren't there expressions deal with interaction entity yet? Or any addon recommended?
Skript-reflect needed.
Code:
import:
  org.bukkit.entity.EntityType

command spawninteraction:
  trigger:
    set {_entity} to (player's world).spawnEntity(location of player, EntityType.INTERACTION)
    {_entity}.setInteractionHeight(5)
    {_entity}.setInteractionWidth(5)

on rightclick:
  clicked entity is set
  (clicked entity).getType() is EntityType.INTERACTION
  broadcast "You clicked interaction entity"

on damage:
  victim.getType() is EntityType.INTERACTION
  broadcast "You hit interaction entity"