Text (Entity Action Type)
Shows text on the target player's screen at a chosen position, with fade in, stay and fade out timing. The position can be one of the vanilla title, subtitle and actionbar slots or one of Apoli's own HUD anchors. Each entry in a text list carries its own condition, so one action can show several segments side by side and restyle or hide each one, for example two options where the active one is highlighted. Colours and other styling come from the text components themselves, and there is no separate colour field.
Type ID: apoli:text (aliases apoli:text_bar and apoli:show_text)
Fields
| Field | Type | Default | Description |
|---|---|---|---|
text | Text Component, or list of text entries | required | What to show. A plain string or text component, or a list of text entries (see below) joined in order. Entries whose condition fails are skipped. |
bar | String | actionbar | Where to show it: actionbar, title, subtitle, top_left, top_center, top_right, left, right, bottom_left or bottom_right. |
bold | Boolean | false | Base bold styling. |
italic | Boolean | false | Base italic styling. |
underlined | Boolean | false | Base underline styling. |
strikethrough | Boolean | false | Base strikethrough styling. |
obfuscated | Boolean | false | Base obfuscated styling. |
fadein | Integer | 10 | Fade in time in ticks. |
duration | Integer | 70 | How long the text stays fully visible, in ticks. -1 keeps it until it is replaced or cleared, like duration: -1 on Apply Effect. |
fadeout | Integer | 20 | Fade out time in ticks. |
Text entries
Each element of a text list is an object with these fields:
| Field | Type | Default | Description |
|---|---|---|---|
text | Text Component | required | The text of this segment. Full vanilla text components work. |
condition | Entity Condition Type | optional | The segment only shows while this condition passes. It is tested on the player the text is shown to, on the server. |
Notes
- Each
barposition holds one text per player, and sending to the same bar replaces what is there. Sending an emptytext, or a list where no entry passes, clears that bar, so conditional entries disappear when nothing applies. - Every bar draws above the chat overlay, so
bottom_leftandleftstay readable while chat is open or scrolled. - The action is built for
interval: 1loops. The finished text is only sent when it changes, and timed texts are refreshed about halfway through their stay so they never flicker out while the action keeps firing. That avoids the per-tick parsing cost of running/titlethroughexecute_commandevery tick. titleandsubtitlerender at vanilla title size in the middle of the screen through Apoli's own overlay, so they never clash with vanilla/titleoutput.top_centersits just below the boss bar area.- The action only works on players, since the target needs a screen. Segment conditions are evaluated on the server.
Example
A selector with two options side by side. The selected one, tracked by a resource, is white and bold, and the other is grey:
{
"type":"apoli:action_over_time",
"entity_action":{
"type":"apoli:text",
"bar":"actionbar",
"duration":20,
"text":[
{
"text":{
"text":"FIRST ORDER ",
"color":"#FFFFFF"
},
"condition":{
"type":"apoli:resource",
"resource":"quirk:neworder/twoorder_resource",
"comparison":"==",
"compare_to":1
}
},
{
"text":{
"text":"FIRST ORDER ",
"color":"#555555"
},
"condition":{
"type":"apoli:resource",
"resource":"quirk:neworder/twoorder_resource",
"comparison":"!=",
"compare_to":1
}
},
{
"text":{
"text":"SECOND ORDER",
"color":"#FFFFFF"
},
"condition":{
"type":"apoli:resource",
"resource":"quirk:neworder/twoorder_resource",
"comparison":"==",
"compare_to":2
}
},
{
"text":{
"text":"SECOND ORDER",
"color":"#555555"
},
"condition":{
"type":"apoli:resource",
"resource":"quirk:neworder/twoorder_resource",
"comparison":"!=",
"compare_to":2
}
}
]
},
"interval":1
}A title shown once on a key press:
{
"type":"apoli:action_on_key_press",
"entity_action":{
"type":"apoli:text",
"bar":"title",
"text":{
"text":"Power unleashed!",
"color":"gold"
},
"bold":true,
"fadein":5,
"duration":30,
"fadeout":10
},
"key":{
"key":"key.use"
}
}