LogoLogo
English
English
  • Welcome!
  • Installation
  • Writing your scripts
    • Commands
    • Tags
    • Events
    • Properties
  • Examples
    • Custom GUI
Powered by GitBook
On this page
  • Event contexts
  • Old docs
  1. Writing your scripts

Events

PreviousTagsNextProperties

Last updated 2 years ago

Since 3.0 version all events are fully (almost) compatible. To use them in your script, simply do this trick:

  1. Get the name of event from the . Let's say DisbandClanEvent.

  2. Then, separate it and write on lower case like so: disband clan (don't add event word!)

  3. That's it! Now you can use it in your script.

my_first_script:
    type: world
    events:
        on disband clan:
            - narrate "<context.clan> was disbanded!"

This trick works with each event in the API. Let me show one more examples:

  • -> on home regroup

  • -> on player home clear

  • -> on pre create clan

  • etc.

One exception here is . The right format is on clan player chats (to not confuse with )

Event contexts

It's actually almost the same trick as it was with the events:

  1. Just remove get and you're ready!

my_first_script:
    type: world
    events:
        on clan balance update:
            - narrate "Clan balance updated! It has <context.balance> money now."
Context
Value from API
SCDenizenBridge return

Old docs

2.1

Event
Contexts

clan ally add

first_clan, second_clan

clan ally remove

first_clan, second_clan

clan balance update

clan, clan_balance, clan_new_balance, updater_name, updater_balance

clanplayer chat

sender, message, receivers

clan create

clan

clan disband

clan

clanplayer home regroup

clan, issuer

clanplayer home set

location, clan, clanplayer

clanplayer demote

clan, clanplayer

clanplayer join

clan, clanplayer

clanplayer kick

clan, clanplayer

clanplayer kill

attacker, victim

clanplayer promote

clan, clanplayer

clanplayer teleport

clanplayer, origin, destination

pre clan create

tag, name

pre rank create

clan, rank_name

clan rival add

first_clan, second_clan

clan rival remove

first_clan, second_clan

clan tag change

tag, clan

clan war end

first_clan, second_clan, reason

frame (<frame>) open

frame

Look for the event's method from the . Let's take .

And from now I should disappoint you a bit: it's not fully compatible with some contexts. Look at the following table:

Don't forget that SCDenizenBridge 3.0.1 doesn't support events from 2.1! If you used 2.1 you will be forced to rewrite all your scripts to the latest format.

⚠️
<context.component>
SCComponent
ItemTag (Component's item)
<context.rank>
Rank
ElementTag (Rank Name)
<context.request>
Request
ElementTag (Request type name)
<context.reason>
WarEndEvent.Reason
ElementTag (Reason name)
<context.updater>
BankOperator
ElementTag (Operator Name)
<context.cause>
ClanBalanceUpdateEvent.Cause
ElementTag (Cause name)
<context.war>
War
ListTag(Two warring clans)
⚠️
⚠️
API
HomeRegroupEvent
PlayerHomeClearEvent
PreCreateClanEvent
ChatEvent
denizen one
API
ClanBalanceUpdateEvent#getBalance