Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Minecraft Attack Speed Regulation System by CrushedPixel
- ========================================================
- To set up the attack speed regulation, you need to create 4 Scoreboard Objectives:
- /scoreboard objectives add attacked stat.damageDealt
- /scoreboard objectives add attackCD dummy
- /scoreboard objectives add cooldownValue dummy
- /scoreboard objectives add armSwing dummy
- Then, put the following commands (in that execution order!) on a fill clock:
- /scoreboard players set @a[score_attacked_min=1] armSwing 0
- /scoreboard players add @a[score_armSwing=9] armSwing 1
- /scoreboard players remove @a[score_attackCD_min=1] attackCD 1
- /execute @a[score_attacked_min=1] ~ ~ ~ /scoreboard players operation @p attackCD = @p cooldownValue
- /effect @a[score_attackCD_min=1] minecraft:weakness 10 100 true
- /effect @a[score_armSwing_min=10] minecraft:haste 10 10 true
- /effect @a[score_armSwing_min=10] minecraft:mining_fatigue 10 10 true
- /effect @a[score_attackCD=0] minecraft:mining_fatigue 0
- /effect @a[score_attackCD=0] minecraft:haste 0
- /effect @a[score_attackCD=0] minecraft:weakness 0
- /scoreboard players set @a attacked 0
- How to use:
- Simply set the cooldownValue score for a player to a specific value, and after hurting a mob or player he will have to wait
- [cooldownValue] ticks until he can hit again.
- Please note that this method of regulating a player's attack speed makes him unable to mine any blocks. This is required to create the visual effect of the player not swinging his weapon when clicking (which is done using weakness and haste effects).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement