# ClearLag - A replacement script for the plugin called ClearLagg # By Mwthorn # Use "/clearlag clear" to request a clear. (goes outside the normal timer) # Use "/clearlag" to check when the next clear is inbound. # Config Area below ClearLag_Data: type: yaml data config: timer: # Here you can change the time for each clear and adjust it to the player-base on the server. # This means that there will be faster clear times if more players are online. # This is because; if a lot of players are online, many items could be dropped. (depends on your server gamemode) # The example goes like this: # Players 0-40 = 3m delay per clear # Players 40-70 = 2m delay per clear # Players 70-100 = 1m delay per clear # Players 100-1000 = 1m delay per clear 1: players: 40 time: 3m 2: players: 70 time: 2m 3: players: 100 time: 1m 4: players: 1000 time: 1m # End of config (beyond is the actual script code, edit if you know what you are doing) ClearLag_Events: type: world events: on server start: - run Clearlag_Event_Cycle instantly on system time hourly: - wait 25s - if { - wait 5s - if { - run Clearlag_Event_Cycle instantly } } Clearlag_Event_Cycle: type: task debug: false script: - announce format:util_ff "<&7>Removing all ground items in 10 seconds" - wait 10s - flag server ClearLag_While - define size - while { - if < .players]> { - define time .time]> - flag server ClearLag_While:! } - wait 1t } - flag server ClearLag_Countdown duration: - inject Clearlag_Task - wait - run Clearlag_Event_Cycle instantly Clearlag_Task_Forced: type: task script: - announce format:util_ff "<&7>Staff has requested to remove items in 3 seconds" - wait 3s - inject Clearlag_Task Clearlag_Task: type: task debug: false script: - define arrows - define items - define total ]> - remove - announce format:util_ff "<&7>Removed <&e> <&7>items." Clearlag_Commands: type: command debug: false name: clearlag aliases: - lagg - cleartime - cleart - cleartid - clearlagtime - clearlagtid - clearlagg - clearlaggtime script: - if && >= 1 { - if == "clear" { - inject Clearlag_Task_Forced } - queue clear } - narrate format:util_ff "Next clear lag is in <&b>"