-
Notifications
You must be signed in to change notification settings - Fork 0
Action Items
Source package: com.jopre.streamlink.action.type
An Action Item is a single step in a StreamLink action list (see com.jopre.streamlink.action.Action
/ ActionList) — for example "send a chat message," "give the player an item," or "sleep for N
seconds." Each concrete class below extends the abstract com.jopre.streamlink.action.ActionItem
base class and represents one JSON object in an action's step array.
Enums referenced by these classes are documented separately on the Action Item Enums page and linked from the relevant field below.
ActionItemDeserializer reads the itemType field of each JSON object, maps it to an
ActionItemType constant, and deserializes the object into the matching class listed in the
table below. If itemType is missing or doesn't match a known value, it falls back to
DummyActionItem.
itemType JSON value |
Action Item Class |
|---|---|
chat-action |
ChatActionItem |
command-action |
CommandActionItem |
dummy (or unrecognized) |
DummyActionItem |
effect-action |
EffectActionItem |
give-action |
GiveActionItem |
monster-action |
MonsterActionItem |
move-player |
MovePlayerActionItem |
play-sound |
PlaySoundActionItem |
sleep |
SleepActionItem |
toast-action |
ToastActionItem |
variable-math |
VariableMathActionItem |
variable-persistence |
VariablePersistenceActionItem |
variable-storage |
VariableStorageActionItem |
variable-value |
VariableValueActionItem |
Every Action Item below inherits these two fields from the abstract ActionItem base class, in
addition to whatever fields are listed in its own section.
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
itemType |
itemType |
ActionItemType |
What Type of action are we performing |
target |
target |
String | What player are you targetting with the action. Can use the variable #MINECRAFT.ME# to target yourself |
A few Action Items below don't use primitive fields directly but instead reference these small
supporting classes from com.jopre.streamlink.action.items. They aren't Action Items themselves,
so they aren't full sections, but their fields are documented here since they show up in the
sample JSON for GiveActionItem and MonsterActionItem.
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
itemName |
itemName |
String | What is the ID of the item to give |
slot |
slot |
EquipmentSlot |
IF the equipment is to be put in a slot what slot is it |
enchantments |
enchantments |
List of Enchantment
|
If enchanting the item. This is the list of enchants |
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
enchantName |
enchantName |
String | what is the ID of the enchantment_ |
enchantLevel |
enchantLevel |
Integer | WHat level are we enchanting at |
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
attributeKey |
attributeKey |
String | What is the ID of the attribute. Check the minecraft documentation for the correct values for your minecraft version |
attributeValue |
attributeValue |
Double | What value are we setting for the attribute |
TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
chatMessage |
chatMessage |
String | What is the chat message for to send to the local player |
Sample JSON
{
"itemType": "chat-action",
"target": "streamer",
"chatMessage": "Thanks for the raid, #event.user-name#!"
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
commandName |
commandName |
String | What is the minecraft command to execuate |
Sample JSON
{
"itemType": "command-action",
"target": "console",
"commandName": "give @a minecraft:diamond 1"
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
effectName |
effectName |
String | What is the ID of the effect to give to the target |
amplifier |
amplifier |
Integer | The amplifier for the effect 0 = Level 1, 1 = level 2 and so on |
duration |
duration |
Integer | The duration of the effect. |
Sample JSON
{
"itemType": "effect-action",
"target": "#MINECRAFT.ME#",
"effectName": "minecraft:speed",
"amplifier": 1,
"duration": 200
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
itemToGive |
itemToGive |
List of Equipment
|
Give One or more items to the target |
Sample JSON
{
"itemType": "give-action",
"target": "#MINECRAFT.ME#",
"itemToGive": [
{
"itemName": "minecraft:diamond_sword",
"slot": "main-hand",
"enchantments": [
{ "enchantName": "sharpness", "enchantLevel": 3 }
]
}
]
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
monsterName |
monsterName |
String | The ID of the Monster |
displayName |
displayName |
String | The name of the displayed monster |
monsterEffects |
monsterEffects |
List of EffectActionItem
|
What effects to give the mob |
tagList |
tagList |
List of String | What Tags to apply to the Mob |
glowing |
glowing |
Boolean | Should the mob have a glowing effect |
persistent |
persistent |
Boolean | Should the mob despawn in unloaded chunks |
equipment |
equipment |
List of Equipment
|
Any equipment to be spawned with the mob |
attributeList |
attributeList |
List of Attribute
|
What attributes |
immuneToZombification |
immuneToZombification |
Boolean | Can the Mob become a zombie (Piglins, Piglin Brutes, etc) |
Sample JSON
{
"itemType": "monster-action",
"target": "#MINECRAFT.ME#",
"monsterName": "minecraft:zombie",
"displayName": "Twitch Raider",
"monsterEffects": [
{
"itemType": "effect-action",
"target": "monster",
"effectName": "minecraft:speed",
"amplifier": 2,
"duration": 400
}
],
"tagList": ["streamlink-spawn"],
"glowing": true,
"persistent": true,
"equipment": [
{ "itemName": "minecraft:iron_helmet", "slot": "head", "enchantments": [] }
],
"attributeList": [
{ "attributeKey": "generic.max_health", "attributeValue": "40.0" }
],
"immuneToZombification": true
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
moveX |
moveX |
Double | Blocks in the X direction |
moveY |
moveY |
Double | Blocks in the Y direction |
moveZ |
moveZ |
Double | Blocks in the Z direction |
relative |
relative |
Boolean | If true it will move the target to the exact coordinates, if false it will send them that many blocks in the X, Y, Z direction |
Sample JSON
{
"itemType": "move-player",
"target": "#MINECRAFT.ME#",
"moveX": 10.5,
"moveY": 64.0,
"moveZ": -3.0,
"relative": true
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
soundName |
soundName |
String | TODO: description |
soundSource |
soundSource |
String | TODO: description |
volume |
volume |
Float | TODO: description |
pitch |
pitch |
Float | TODO: description |
Sample JSON
{
"itemType": "play-sound",
"target": "#MINECRAFT.ME#",
"soundName": "minecraft:entity.player.levelup",
"soundSource": "MASTER",
"volume": 1.0,
"pitch": 1.0
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
sleepTime |
sleepTime |
Integer | How long to sleep |
timeUnit |
timeUnit |
TimeUnits |
The Unit of time to sleep in |
Sample JSON
{
"itemType": "sleep",
"target": "action-queue",
"sleepTime": 5,
"timeUnit": "seconds"
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
title |
title |
String | The Title of the toast |
message |
message |
String | The text of the toast |
Sample JSON
{
"itemType": "toast-action",
"target": "#MINECRAFT.ME#",
"title": "New Follower!",
"message": "#event.user-name# just followed the channel!"
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
inputVariableName |
inputVariableName |
String | The variable containing the input |
outputVarName |
outputVarName |
String | Variable to store the output in |
inputOperand |
inputOperand |
String | The variable Name or value to perform the math opertion to the input variable |
operation |
operation |
VariableMathOperation |
The Type or arithmatic operation |
Sample JSON
{
"itemType": "variable-math",
"inputVariableName": "stream.follower-count",
"outputVarName": "stream.follower-count",
"inputOperand": "1",
"operation": "ADDITION"
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
saveVariables |
saveVariables |
Boolean | true to save variables, false to load them |
Sample JSON
{
"itemType": "variable-persistence",
"saveVariables": true
}TODO: description
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
varName |
varName |
String | The variable to delcare |
varValue |
varValue |
String | The initial Value to set it to |
variableScope |
variableScope |
VariableScope |
The Variable scope |
dataType |
dataType |
VariableDataType |
The data type of the variable |
Sample JSON
{
"itemType": "variable-storage",
"target": "none",
"varName": "stream.last-raider",
"varValue": "#event.user-name#",
"variableScope": "global",
"dataType": "string"
}TODO: description — new since the last wiki pass; not yet present in the deployed docs.
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
variableName |
variableName |
String | The variable name to set |
variableValue |
variableValue |
String | The value to set the variable to |
Sample JSON
{
"itemType": "variable-value",
"variableName": "stream.last-raider",
"variableValue": "#event.user-name#"
}Description — This action Item will display and update a boss bar
| Field | JSON Key | Data Type | Description |
|---|---|---|---|
bossBarName |
bossBarName |
String | The Uniqueue Minecraft ID of the bossbar |
bossBarDesc |
bossBarDesc |
String | The Title of the boss bar on screen |
curAmountVarName |
curAmountVarName |
String | The Variable Name which contains the current progress amount for the boss bar |
totAmountVarName |
totAmountVarName |
String | The Variable Name which contains the amount to complete the boss bar |
{
"bossBarName": "stream-link-bar",
"bossBarDesc": "Current Level #stream-link-level# (#stream-link-current-xp#/#stream-link-xp-goal#)",
"curAmountVarName": "stream-link-current-xp",
"totAmountVarName": "stream-link-xp-goal",
"itemType": "boss-bar",
"target": "#MINECRAFT.ME#"
}