1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Force player right click

Discussion in 'Skript' started by Mattllama987, Mar 19, 2020.

Thread Status:
Not open for further replies.
  1. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Hello, im trying to make a Auto Fishing skript, and need a little help with something. Im not sure how i can make a player right click. I have the code to make the player left click, but not right click. If anyone knows how to do this. Please let me know.
    Thanks!
    ~Matt


    Code (Text):
    1. option NMS:
    2.   get:
    3.     return 4th element out of ((class "org.bukkit.Bukkit").getServer().getClass().getPackage().getName() split at ".")
    4. import:
    5.   net.minecraft.server.{@NMS}.PacketPlayOutAnimation
    6.  
    7. effect make %players% (attack|swing) [for %-players%]:
    8.   trigger:
    9.     loop exprs-1:
    10.       set {_handle} to loop-value.getHandle()
    11.       set {_packet} to new PacketPlayOutAnimation({_handle}, 0)
    12.       loop exprs-2 ? all players:
    13.         loop-value-2.getHandle().playerConnection.sendPacket({_packet})
     
  2. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    44
  3. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    I have no idea what any of that stuff means xDDDD Im just starting to learn what packets are and stuff hahahaha
    --- Double Post Merged, Mar 20, 2020, Original Post Date: Mar 19, 2020 ---
    bump
     
  4. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    101
    Likes Received:
    4
    Maybe...

    Code (Text):
    1. command /autofish <text> <text>:
    2.   if {autofish} = false:
    3.     set {autofish} to true
    4.   if {autofish} = true:
    5.     set {autofish} to false
    6.  
    7. on right click:
    8.   if target-block is water:
    9.      if {autofish} = true:
    10.       if player is holding a fishing rod:
    11.         loop 1000 times:
    12.           make player click
    I am no genius XD but I tried I actually don't know if you can tho. Why don't you just use the pressure plate, fence, noteblock, autoclicker, and trapdoor method for autofishing?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...