A modification that allows you to receive events from DonationAlerts
Supports:
Allows to:
You can download this from: Modrinth, CurseForge or Releases
There are several ways to set your token here.
/da set
NO NEED to insert a token into the chat! The token will be taken from your clipboard.
C:\Users\<your user>\.donation-alerts-token
~/.donation-alerts-token
To connect to Donation Alerts, use the command in Minecraft
/da connect
To check connection status you can use command
/da status
And there is the command to disconnect
/da disconnect
The settings file is in .minecraft/donation-alerts-integrate/settings.yaml
The file format is yaml, example:
disableSettingsUpdateMessage: false
disableWelcomeMessage: false
triggers:
- name: default
description: example trigger
isActive: true
sensitives:
- properties:
type: daintegrate/sensitive/donate
value:
from: 5
to: 10
currency: USD
handlers:
- delay: 0 # Any comment you can type here!
properties:
type: daintegrate/handler/message
value:
message: Hello, <donation_username>! This is an example message for all events from Donation Alerts
- delay: 10
properties:
type: daintegrate/handler/command
value:
command: time set day # The sun is rising
- name: Subscribtion
isActive: true
sensitives:
- properties:
type: daintegrate/sensitive/subscribe
value:
type: YouTubeSubscription
handlers:
- properties:
type: daintegrate/handler/message
value:
message: <donation_username> just subscribe to YouTube!
triggers
is a list of events that can trigger by each message from donation alerts
Property | Description |
---|---|
name | Just a name of trigger |
description | Description of trigger |
isActive | Enables or disables the trigger. If isActive = false , the trigger will not be activated |
sensitive | Conditions for trigger activation see #Sensitive for learn more |
handlers | Handlers inside the trigger, execute any registered commands. You can create your own mod that will add a custom handler See #Handlers for lean more |
Conditions for trigger activation.
The DonationAlertsIntegrate provides multiple sensitive
Type | Description |
---|---|
daintegrate/sensitive/always |
Activates for any event |
daintegrate/sensitive/donate |
Activates for specific donation |
daintegrate/sensitive/subscribe |
Activates for subscribe |
daintegrate/sensitive/twitch/bits |
Activates for specific bits |
Has no parameters
sensitives:
- properties:
type: daintegrate/sensitive/always
Activates if the amount falls within the specified range (from
<= amount <= to
).
And the currency matches.
Name | Type | Description |
---|---|---|
from |
number | Left side number |
to |
number | Right side number |
currency |
text | Currency in the ISO 4217 code |
sensitives:
- properties:
type: daintegrate/sensitive/donate
value:
from: 5
to: 10
currency: USD
Activates if the type
is matches
Name | Type | Description |
---|---|---|
type |
enum | Type to match, see below for available types |
sensitives:
- properties:
type: daintegrate/sensitive/subscribe
value:
type: YouTubeSubscription
Activates if the amount of Twitch points falls within the specified range (from
<= amount <= to
).
Name | Type | Description |
---|---|---|
from |
number | Left side of the Twitch bits amount |
to |
number | Right side of the Twitch bits amount |
sensitives:
- properties:
type: daintegrate/sensitive/twitch/points
value:
from: 0
to: 1000
Activates if the amount of Twitch bits falls within the specified range (from
<= amount <= to
).
Name | Type | Description |
---|---|---|
from |
number | Left side of the Twitch bits amount |
to |
number | Right side of the Twitch bits amount |
sensitives:
- properties:
type: daintegrate/sensitive/twitch/bits
value:
from: 0
to: 2000
Handlers for the trigger.
Perform actions when the trigger is activated.
Type | Description |
---|---|
daintegrate/handler/message |
Adds a message to your chat |
daintegrate/handler/command |
Sends a command to the server on your behalf |
Each handler, in addition to the properties object, has a delay
property, it indicates after how many ticks the command will be executed.
By default, 1 second in minecraft is 20 ticks
In commands and messages, you can specify patterns that will be replaced with the corresponding values.
<donation_message>
<donation_amount>
<donation_currency>
<donation_username>
<minecraft_playername>
Adds a message to your chat
Name | Type | Description |
---|---|---|
message |
text | A message which will be added to the chat |
handlers:
- delay: 10
properties:
type: daintegrate/handler/message
value:
message: Hello! It's day time!
Sends a command to the server on your behalf
Name | Type | Description |
---|---|---|
command |
text | A command which will be send to the server (without slash / ) |
handlers:
- delay: 10
properties:
type: daintegrate/handler/command
value:
command: time set day
// todo: add information abount sub modifications
If you want to contribute, you can:
Modifications
, example: "fabric_1.20"Modifications/settings.gradle
var cfgSource = DonationAlertsIntegrateFactory.create(
"donation-alerts-integrate",
"settings.yaml",
LOGGER::info);
DonationAlertsIntegrate.configure(Constants.ModId, Constants.ModUrl)
.registerHandler(new MessageHandler())
.registerHandler(new CommandHandler());
cfgSource.addListener(settings -> { });
Consider the setting that allows to disable this message!
DonationAlertsClient
var listener = new DonationAlertsEventListener(new EventProcessor(), DonationAlertsIntegrate.getEventListeners());
var client = new DonationAlertsClient(Constants.DonationAlertsEventServer, listener);
cfgSource.startListening()
as late as possible.MinecraftForge: https://github.com/MinecraftForge/MinecraftForge
Socket.io: https://github.com/socketio/socket.io-client-java
JSON-java: https://github.com/stleary/JSON-java