Force Right Click

  • Thread starter Deleted member 21504
  • Start date
  • 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 community!

    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!

D

Deleted member 21504

I'm trying to force the player to perform a right click (as a server-side autoclicker for Slimefun). This is my code, and here are my errors:
code_language.skript:
import:
    org.bukkit.event.player.PlayerInteractEvent

command /fakeclick:
    permission: *
    trigger:
        set {_click} to new PlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, player's tool, target block, (target block).getBlockFace())
        Bukkit.getPluginManager().callEvent({_click})
IMG_2781.jpeg


I got the original code from this thread.

Server version 1.19.4 PaperMC.
Skript info:
IMG_2782.jpeg


If anyone can tell me how to fix this, that would be greatly appreciated. If anyone could tell my why it doesn't work, that would be appreciated even more. Thank you.