Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

Auto Attack Code Check

Discussion in 'Questions' started by creeperkingcreep, Sep 6, 2024.

  1. creeperkingcreep

    creeperkingcreep Well-Known Adventurer CHAMPION

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    45
    Minecraft:
    I saw that Auto Attack when left is held down is allowed, but I couldn't find a mod on fabric 1.21 that could do it so I decided to make one.

    I wanted to know if this code (attached as image) is allowed/correct

    I really don't want to accidentally send 50 'attack ___' packets per tick

    also the reason for the attack block was to attack the air since idk the range of the entity detection.
     

    Attached Files:

  2. Vicvip

    Vicvip Warrior enthusiast VIP

    Messages:
    6
    Likes Received:
    3
    Trophy Points:
    45
    Guild:
    Minecraft:
    i don't see any apparent issues right out of the bat. should work fine. although personally i'd just write an ahk script, it should be enough
     
  3. creeperkingcreep

    creeperkingcreep Well-Known Adventurer CHAMPION

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    45
    Minecraft:
    The reason I wanted this as a mod is because (afaik) AHK can't read in-game cooldowns, so I wanted it to go as soon as a cooldown is finished rather than just an auto clicker. I also don't want to be conscientious about having to continuously toggle an auto clicker if something is needed and instead just hold down the button. When it comes to the code, I am just cautious because I don't want to accidentally send a click packet every frame xd

    (idk much about networking or much about how minecrafts multiplayer works, just assumptions based on not needing to send useless information)