Paste #83474: ClearLag V1.2

Date: 2021/04/15 14:32:18 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#==========================================================#
# Code by BillyTee (Chano)
# Zen ClearLag
# Clears Lag on an Interval
# Version 1.2
# April 15, 2021
#==========================================================#

#==========================================================#
# Config:

cl_config:
    type: data
    # World name of the world for Entities and Items to be cleared in:
    world: IridiumSkyblock
    # Remove Both Items and Mobs/Animals? Or just Items? (true for Both, false for Just Items)
    entities: true

clearlag_interval:
    type: world
    debug: false
    events:
        after system time minutely every:15:
        - actionbar "<&e><&l>Entities and Ground Items will be removed in..." targets:<world[<script[cl_config].data_key[world]>].players>
        - wait 1s
        - repeat 4:
          - actionbar "<&e><&l><element[5].sub[<[value]>]> <&7> Seconds" targets:<world[<script[cl_config].data_key[world]>].players>
          - wait 1s
        - actionbar "<&b>Removed Ground Items and Entities!" targets:<world[<script[cl_config].data_key[world]>].players>
        - playsound <world[<script[cl_config].data_key[world]>].players> sound:ENTITY_EXPERIENCE_ORB_PICKUP volume:1 pitch:1
        - if <script[cl_config].data_key[entities]>:
          - remove Arrow|DROPPED_ITEM|Skeleton|Zombie|Creeper|Ghast|Pig_Zombie|WITHER_SKELETON|SPIDER|SLIME|BLAZE|ENDERMAN|IRON_GOLEM|WITHER world:<script[cl_config].data_key[world]>
        - else:
          - remove Arrow|DROPPED_ITEM world:<script[cl_config].data_key[world]>
        - wait 2s
        - actionbar "<&7>Entities and Ground Items have been cleared. Next Clear in <&e><&l>15 Minutes" targets:<world[<script[cl_config].data_key[world]>].players>
        - stop

#CLEARLAG COMMAND /clearlag | /lagclear
clearlagcmd:
  type: command
  name: clearlag
  description: Clears Entities.
  usage: /clearlag
  aliases:
  - lagclear
  script:
  - actionbar "<&e><&l>Entities and Ground Items will be removed in..." targets:<world[<script[cl_config].data_key[world]>].players>
  - wait 1s
  - repeat 4:
    - actionbar "<&e><&l><element[5].sub[<[value]>]> <&7> Seconds" targets:<world[<script[cl_config].data_key[world]>].players>
    - wait 1s
  - actionbar "<&b>Removed Ground Items and Entities!" targets:<world[<script[cl_config].data_key[world]>].players>
  - playsound <world[<script[cl_config].data_key[world]>].players> sound:ENTITY_EXPERIENCE_ORB_PICKUP volume:1 pitch:1
  - if <script[cl_config].data_key[entities]>:
    - remove Arrow|DROPPED_ITEM|Skeleton|Zombie|Creeper|Ghast|Pig_Zombie|WITHER_SKELETON|SPIDER|SLIME|BLAZE|ENDERMAN|IRON_GOLEM|WITHER world:<script[cl_config].data_key[world]>
  - else:
    - remove Arrow|DROPPED_ITEM world:<script[cl_config].data_key[world]>
  - stop