Listening For Disasters
Using the API you can listen for when a disaster starts and access the variables, level, location, attached player, or cancel it. There are two types of disasters as earlier specified destruction disasters and weather disasters, each has its own event. This is how you can listen for a destruction disaster and cancel it if it's a sinkhole:
Here is an example of canceling any weather disaster that is over level 3:
You can cast the disaster from the event to then access and modify its variables like this:
You can also check the type of disaster with an enum like this:
If you need any help or you're having problems you can join the discord to get fast support, if you have any ideas or suggestions you can also leave them there.
Last updated