Jump to content

CombatLog - Fully Customisable


kegnh

Recommended Posts

#  ,-----.                 ,--.             ,--.  ,--.                  
# '  .--./ ,---. ,--,--,--.|  |-.  ,--,--.,-'  '-.|  |    ,---.  ,---.  
# |  |    | .-. ||        || .-. '' ,-.  |'-.  .-'|  |   | .-. || .-. | 
# '  '--'\' '-' '|  |  |  || `-' |\ '-'  |  |  |  |  '--.' '-' '' '-' ' 
#  `-----' `---' `--`--`--' `---'  `--`--'  `--'  `-----' `---' .`-  /  
#                                             by kegnh#1234     `---'   

# #########################
# #     Plugin Config     #
# #########################
options:
    cooldown: 5 seconds # how long the player will be in combat.

    message-type: message # where the message will be sent (message, action bar, title)
    start-message: "&cCOMBAT &8| &fYou are in combat, if you log out you will be killed." # the message sent to the player when they enter combat.
    end-message: "&cCOMBAT &8| &fYou are no longer in combat, you can now logout safely." # the message sent to the player when they leave combat.

    disable-commands: true # when 'true' disables all commands while in combat.
    disable-chat: false # when 'true' players will not be able to speak in chat while in combat.
    disable-pickup: false # when 'true' players will not be able to pickup items while in combat.
    disable-drop: false # when 'true' players will not be able to drop items while in combat.

    command-error: "&cCOMBAT &8| &fYou cannot use commands in combat." # the message sent to the player when they try to use a command while in combat.
    chat-error: "&cCOMBAT &8| &fYou cannot chat in combat." # the message sent to the player when they try to chat while in combat.
    pickup-error: "&cCOMBAT &8| &fYou cannot pickup items while in combat." # the message sent to the player when they try to pickup an item while in combat.
    drop-error: "&cCOMBAT &8| &fYou cannot drop items while in combat." # the message sent to the player when they try to drop an item while in combat.

    bypass-enabled: false # when 'true' players with the below permission wont be put in combat log.
    bypass-permission: combatlog.bypass

#  __  
# |  | 
# |  | 
# |  |  WARNING: DO NOT EDIT ANYTHING BELOW THIS LINE!
# |__|           EDITING THE FILE MAY BREAK IT.
#  __  
# |__| 
# 

on damage:
    victim is a player
    attacker is a player
    if {@bypass-enabled} is true:
        if victim has permission "{@bypass-permission}":
            stop
    set metadata tag "combatLog" of victim to now
    send {@message-type} {@start-message} to victim
    wait {@cooldown}
    difference between now and (metadata tag "combatLog" of victim) >= {@cooldown}
    send {@message-type} {@end-message} to victim

on command:
    metadata tag "combatLog" of player is set
    difference between now and metadata tag "combatLog" of player < {@cooldown}
    {@disable-commands} is true
    cancel event
    send {@command-error} to player

on chat:
    metadata tag "combatLog" of player is set
    difference between now and metadata tag "combatLog" of player < {@cooldown}
    {@disable-chat} is true
    cancel event
    send {@chat-error} to player

on drop:
    metadata tag "combatLog" of player is set
    difference between now and metadata tag "combatLog" of player < {@cooldown}
    {@disable-drop} is true
    cancel event
    send {@drop-error} to player

on pickup:
    metadata tag "combatLog" of player is set
    difference between now and metadata tag "combatLog" of player < {@cooldown}
    {@disable-pickup} is true
    cancel event
    send {@pickup-error} to player

on quit:
    metadata tag "combatLog" of player is set
    difference between now and metadata tag "combatLog" of player < {@cooldown}
    kill player

If you have any issues dm me: kegnh#1234

If you like it leave a like!


Edited by itskegnh
  • Like 2

Minecraft Ranks
[DEFAULT] - 9th October 2020
[PRO] - 21st November 2020
[PATRON] - 27th October 2021

Proficiency
Python - 8 Years
C/C++ - 5 Years
Skript - 4 Years
Javascript - 3 Year
Java - 1 Year

Links
Discord - kegnh#1234

 
Link to comment
Share on other sites

nice

Owner of:

AuxMines

AuxMines is a unique Box Mining server. We have Super Hero ArmourCustom Enchants, Cool BossesChill Community, and Custom Drops  all in one server!

We aren't fully released, so if you wanna drop by and give us some suggestions that would be cool.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...