options:
Cl-world: "world"
Cl-time: 1
Cl-items: boat and item frame
#--------------------------------------------
# Clearlagg
#--------------------------------------------
command /clearlagg [<text="help">] [<integer=30>]:
permission: sk.clearlagg.command
description: Clear All dropped Items & entity
aliases: /cl, /clearlag,
trigger:
if arg 1 is "h" or "help":
message "&e[---------------[&2Clear Lag &e]---------------]"
message "&a/cl all &7 - (Clears entities)"
message "&a/cl check &7 - (Counts all entities)"
message "&a/cl reload&7 - (Reloads schedulers/config)"
message "&a/cl killmobs &7 - (Kills mobs)"
message "&a/cl area <radius> &7 - (Removes entities within given radius)"
if argument 1 is "all":
set {_Deleted} to 0
loop entities in player's world:
add 1 to {_Deleted}
loop-entity is not a player
kill loop-entity-1
loop entities in player's world:
loop-entity-2 is not a {@Cl-items}
clear loop-entity-2
broadcast "<gold>[Clearlag] <lime>%{_Deleted}% Entities Cleard!"
stop
if argument 1 is "check":
set {_Deleted} to 0
loop entities in player's world:
add 1 to {_Deleted}
add the chunk at the loop-entity to {chunk.loc::*}
if {chunk.num::%chunk at loop-entity%} is set:
add 1 to {chunk.num::%chunk at loop-entity%}
else:
set {chunk.num::%chunk at loop-entity%} to 1
broadcast "<gold>[Clearlag] <lime>%{_Deleted}% Entities in your world!"
loop {chunk.loc::*}:
message "&a%loop-value%&f... &9&l%{chunk.num::%loop-value%}%&4 items"
stop
if argument 1 is "reload":
make player execute command "sk reload ClearLag"
if argument 1 is "killmobs":
loop entities in player's world:
add 1 to {_Deleted}
loop-entity-1 is not a {@Cl-items}
kill loop-entity-1
broadcast "<gold>[Clearlag] <lime>%{_Deleted}% Entities Cleard!"
stop
if argument 1 is "area":
set {_Deleted} to 0
loop entities in radius argument 2 around player:
add 1 to {_Deleted}
loop-entity is not a player
loop-entity-1 is not a {@Cl-items}
kill loop-entity-1
clear loop-entity-1
broadcast "<gold>[Clearlag] <lime>%{_Deleted}% Entities Cleard!"
stop
if argument 1 is "test":
set {Clear.message} to {@Cl-time} * 2
broadcast "<gold>[Clearlag] &c Items will be Cleard every &7%{Clear.message}% &cmin"
stop
every {@Cl-time} minutes:
set {Clear.message} to {@Cl-time} * 2
if {Clear.timer} is not set:
broadcast "<gold>[Clearlag] &c Items will be Cleard every &7%{Clear.message}% &cmin"
set {Clear.timer} to 1
stop
if {Clear.timer} is 1:
broadcast "<gold>[Clearlag] &c Items will be Cleard in &71 &cmin"
wait 60 second
set {_Deleted} to 0
loop entities in world {@Cl-world}:
add 1 to {_Deleted}
clear dropped Items
broadcast "<gold>[Clearlag] <lime>%{_Deleted}% Items Cleard"
delete {Clear.timer}
stop