Murmurs
Overheard half-thoughts floating over a speaker's head. Nothing to answer, nothing remembered, and the cheapest characterisation in the game.
Half a thought that was not meant for the player, floating over a speaker's head for a few seconds. Nothing to answer, nothing remembered, and the cheapest characterisation there is: a hostile that mutters something on the way in is a person doing something.
A murmur file
data/<yourpack>/murmurs/<name>.json
{
"speakers": [ "#minecraft:raiders" ],
"lines": [
{ "text": { "translate": "mypack.murmur.cold" } },
{ "text": { "translate": "mypack.murmur.captain" }, "weight": 2 },
{
"text": { "translate": "mypack.murmur.charge" },
"requires": [ { "condition": "doing", "is": "fighting" } ]
}
]
}| Field | Default | Meaning |
|---|---|---|
speakers | required | Entity types or #tags these lines belong to. |
lines | required | The lines themselves. |
when | overheard | overheard for the ordinary kind, brushed_off for the other. |
priority | 0 | Settles which file wins where two disagree. |
requires | none | Conditions asked of every line in the file. |
A line takes the same text, requires, with and weight a variant does, and draws on the same no-repeat memory, so a player is not told the same murmur twice in a row wherever it came from.
Lines gather
Lines gather across every file that covers a speaker, so a file written for one particular mob adds to your general one rather than replacing it, and nobody has to own the file for villagers.
Narrowing a file
A file-level requires asks the same of every line in it, which is how you narrow a file below what speakers can express. A #tag is a kind of entity, and a farmer is not a kind of entity:
{
"speakers": [ "minecraft:villager" ],
"requires": [ { "condition": "profession", "is": [ "minecraft:farmer" ] } ],
"lines": [ { "text": { "translate": "mypack.murmur.farmer.back" } } ]
}File-level conditions are flattened onto the lines as the pack is read, and behave exactly as though written on each line by hand.
Brushed off
{
"speakers": [ "minecraft:villager" ],
"when": "brushed_off",
"lines": [
{ "text": { "text": "Not now! Not now." } },
{ "text": { "text": "Have you seen what is out there?" } }
]
}A brushed_off line is said to a player who tried to start a conversation at a bad moment: the speaker has just been hit, is on fire, has a target, or is running for a doorway. Exactly the states that would have refused the conversation anyway, and no others.
Write these for anything you bind a conversation to
A right-click refused in silence is indistinguishable from a mod that has stopped working, and somebody who will not stop for you ought at least to say so.
A speaker who is asleep, or a merchant already trading with somebody else, is left to vanilla entirely and says nothing. Set interrupts on the binding to let the conversation open regardless, and no brushed_off line is ever reached for it.
Kept deliberately sparse
One speaker at a time, then quiet for the best part of a minute before that speaker says anything again. Lines carry sixteen blocks, so a murmur is something you walk into rather than something broadcast at you.
A square where four people mutter at once is a chat room, and the line you were meant to catch is the one you missed.
Where the text is drawn
Murmurs are drawn in world space over the speaker's head. If your own mod hangs a marker there, say so and murmurs will lift clear of it rather than drawing through it. See WorldText.CROWDING.
Speaking a line from code
For a line over anybody's head with no file and no conversation at all:
MurmurManager.speak(entity, line, earshot);The earshot is yours to choose, since how far something carries depends on what it is. MurmurManager.EARSHOT is the sixteen blocks a murmur uses.
