rajaka wicramasinghe

remove the cooldown time have when using lunge in a spear of any kind withount any other requairment or Item, and auto hit when a player come close to me when I hold a mace, and auto cristal and ancher just by trin to put crystel and ancher without having to use glowstone and obsidian again and crystal and ancher activate t o do dammage to opponent. witount any command or item

Kodari AI
KodariOct 25 at 10:28 pm 1
SpearMaceAutoCombat
Removes lunge cooldown for all spears, enabling instant repeated lunges. Automatically strikes nearby opponents when holding a mace. Auto-places crystals and anchors without glowstone or obsidian requirements, and automatically activates them to damage opponents. All features work without commands or special items.
  1. Add unlimited spear lunges on right-click while holding any spear.

  2. Auto-hit nearby players while holding a mace.

  3. Trigger crystal/anchor-style damage by clicking obsidian, bedrock, or a respawn anchor—no crystal, glowstone, or command required.

Created combat_automation.sk. It lets spear right-clicks lunge without a script cooldown, automatically damages nearby players while you hold a mace, and deals crystal/anchor-style damage when you click obsidian, bedrock, or a respawn anchor—without needing crystal or glowstone items. The blast effect deals damage only; it doesn’t place crystals or create block-damaging explosions.

Place it in plugins/Skript/scripts/, then run /sk reload combat_automation.

Kodari can make mistakes. Review important code before using.
Files
combat_automation.sk
Code
1 40
combat_automation.sk
options:
    mace-range: 3.5
    mace-damage: 6
    blast-range: 5
    blast-damage: 8

on right click:
    if "%type of player's tool%" contains "spear":
        push player in direction of player at speed 1.5

on right click on block:
    if event-block is obsidian or event-block is bedrock or event-block is respawn anchor:
        if {combat::blast::%uuid of player%} is set:
            if difference between now and {combat::blast::%uuid of player%} is less than 1 second:
                stop
        set {combat::blast::%uuid of player%} to now
        set {_center} to location of event-block
        loop all players:
            if loop-player is not player:
                if world of loop-player is world of player:
                    if distance between loop-player and {_center} is less than or equal to {@blast-range}:
                        damage loop-player by {@blast-damage} hearts

every 5 ticks:
    loop all players:
        set {_attacker} to loop-player
        if "%type of {_attacker}'s tool%" contains "mace":
            set {_ready} to false
            if {combat::mace::%uuid of {_attacker}%} is not set:
                set {_ready} to true
            else if difference between now and {combat::mace::%uuid of {_attacker}%} is greater than or equal to 10 ticks:
                set {_ready} to true
            if {_ready} is true:
                set {combat::mace::%uuid of {_attacker}%} to now
                loop all players:
                    set {_target} to loop-player
                    if {_target} is not {_attacker}:
                        if world of {_target} is world of {_attacker}:
                            if distance between {_attacker} and {_target} is less than or equal to {@mace-range}:
                                damage {_target} by {@mace-damage} hearts