Events
Since 3.0 version all events are fully (almost) compatible. To use them in your script, simply do this trick:
Get the name of event from the API. Let's say
DisbandClanEvent
.Then, separate it and write on lower case like so:
disband clan
(don't addevent
word!)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:
HomeRegroupEvent ->
on home regroup
PlayerHomeClearEvent ->
on player home clear
PreCreateClanEvent ->
on pre create clan
etc.
⚠️ One exception here is ChatEvent. The right format is on clan player chats
(to not confuse with denizen one)
Event contexts
It's actually almost the same trick as it was with the events:
Look for the event's method from the API. Let's take ClanBalanceUpdateEvent#getBalance.
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."
⚠️ And from now I should disappoint you a bit: it's not fully compatible with some contexts. Look at the following table:
<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)
Old docs
2.1
⚠️ 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.
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
Last updated