Too Many Attributes
» CommandsPage 15 of 17

Commands

Every TMA command needs permission level 2, the level of /give and /item. Operators, functions and command blocks have it.

Optional arguments are a keyword followed by a value, like duration 600 or viewers @a, and go in any order after the required ones.

CommandWhat it does
/tma with <targets> <command>runs a command with ${…} filled in from each target's variables
/tma powerinv …reads and writes origins:inventory power slots
/tma fakeentity …spawns, lists and removes fake entities only chosen players can see
/tma disguise …, /tma undisguise …makes entities look like another entity type
/tma global …looks at and changes the global store
/tma fakeblock …shows chosen players a different block at a position
/tma chunkload …keeps the chunks around an entity loaded, following it
/tma tickrate <targets> …slows, freezes or speeds up entities
/tma keys watch|stopshows a player's held keybinds and key sequence progress live
/tma obfuscate …, /tma unobfuscate …shows players' names as magic text to chosen viewers
/tma tablist hide|show …leaves players out of chosen viewers' tab list
/tma powertag …shows which powers a tag covers
/disableshield <targets> <ticks>knocks down a raised shield and puts it on cooldown
/tmavc …voice chat: broadcast, forced mute, forced deafen

TMA's attributes are read with vanilla's /attribute. TMA's gamerules are set with vanilla's /gamerule.


/tma with

mcfunction
tma with <targets> <command>

For each target, fills in every ${expression} in <command> from that target's variables and lists, then runs the command as that target, like execute as. Position, dimension and permission level stay those of whoever ran it.

Argument
<targets>any entity selector. Each target runs the command once
<command>the rest of the line: any command, without the leading /
  • Result: the sum of the commands' results.
  • Fails, and runs nothing, if any target's placeholders can't be filled in. The error says which target and why.
  • Placeholders always become text. $${ is a literal ${.
mcfunction
tma with @a title @s actionbar {"text":"${coins} coins"}
tma with @s scoreboard players set @s level ${(int) (xp / 100)}

Full details are on page 9.


/tma powerinv

mcfunction
tma powerinv get   <target> <power> <slot>
tma powerinv id    <target> <power> <slot>
tma powerinv set   <target> <power> <slot> <item> [count]
tma powerinv clear <target> <power> [slot]
tma powerinv copy  <from> <to>
tma powerinv move  <from> <to>

<from>/<to> are power <target> <power> <slot> or entity <target> <slot>. Slots in a power are container.0, container.1, and so on.

SubcommandResult
getthe item count in the slot
idprints the item id as plain text (minecraft:spruce_log) and returns its registry number
setthe count set
clearitems removed from one slot, or stacks removed from the whole power
copythe count copied (overwrites the destination)
movethe count moved (only into an empty destination)

Full details and examples are on page 14.


/tma fakeentity

mcfunction
tma fakeentity spawn  <owner> <entity_type> <pos> <lifetime> [behavior <behavior>] [viewers <viewers>] [id <id>]
tma fakeentity player <owner> <username> <pos> <lifetime> [behavior <behavior>] [viewers <viewers>] [id <id>]
tma fakeentity remove <id>
tma fakeentity run <id> <command>
tma fakeentity remove-all <owner>
tma fakeentity list

Spawns and removes fake entities, the same as the spawn_fake_entity and despawn_fake_entity actions. player spawns a fake player that looks like the player with that username.

Argument
<owner>one entity: the fake entity's spawner. It spawns in this entity's dimension, facing the way it faces.
<entity_type>what it looks like, like minecraft:zombie. Any summonable type
<username>(player) the player the fake player looks like
<pos>where it spawns. ~ ~ ~ is where the command runs
<lifetime>ticks until it disappears, at least 1
behavior <behavior>hostile, neutral, passive or stationary: its behavior. Default neutral for spawn and stationary for player
viewers <viewers>players who can see it. Left out: every player nearby.
id <id>a whole number, 1 or more, to remove it by later. Left out: the next free id is assigned. Unique across the server: reusing a live id replaces that fake entity.
SubcommandResult
remove <id>1 if a fake entity had that id, and 0 if none did. Suggests the ids of live fake entities.
run <id> <command>runs <command> as the fake entity, at its position, facing and dimension, so @s is the fake entity. Returns the command's result, and fails for a missing fake entity. See what works on a fake entity.
remove-all <owner>how many of that entity's fake entities went
listevery live fake entity with its id, type, position, ticks left and viewer count. Returns how many
  • viewers is decided once, when the command runs, like viewer_condition with recheck: false. Players who join later can't see it.
  • With viewers, the fake entity depends on its owner. Once the owner has left or unloaded, no new viewers get it.
  • Result: spawn and player return the fake entity's id, and their feedback says it (Spawned fake entity 3: …). Store it with execute store result to remove that fake entity later. They fail for types that can't be summoned.
  • Assigned ids are the lowest one no live fake entity has, so ids freed by despawning are used again. A pack's own id can collide with an assigned one and replace that fake entity.
  • No NBT here. To equip a fake entity from a command, spawn it and then use tma fakeentity run <id> item replace entity @s armor.head with minecraft:golden_helmet.
  • For a fake player use player. Players aren't a summonable type, so spawn minecraft:player fails.
mcfunction
execute store result score @s stalker run tma fakeentity spawn @s minecraft:zombie ^ ^ ^8 200 behavior hostile viewers @s
tma fakeentity player @s Notch ~ ~ ~2 400 id 50 viewers @s
tma fakeentity run 50 effect give @s minecraft:glowing 5
tma fakeentity remove 50
tma fakeentity list

The first spawns a zombie 8 blocks in front of you that only you can see and that hunts you for 10 seconds, and keeps its id in your stalker score. The second picks id 50 itself.

To remove a fake entity by the id in a score, fill it in with /tma with:

mcfunction
tma with @s tma fakeentity remove ${Scoreboard.get("stalker")}

/tma disguise

mcfunction
tma disguise <targets> <entity_type> [duration <ticks>] [viewers <viewers>]
tma undisguise <targets>

Disguises entities as another entity type, or removes the disguise, the same as the disguise and undisguise actions.

Argument
<targets>entities to disguise or undisguise
<entity_type>what they look like. Any summonable type except players
duration <ticks>ticks until it ends. Left out or 0 lasts until undisguise
viewers <viewers>players who see the disguise. Everyone else sees the real entity. Left out: everyone.
  • viewers is decided once, when the command runs, like viewer_condition with recheck: false.
  • Disguising an entity that's already disguised replaces the disguise.
  • Result: disguise returns the number of targets. undisguise returns how many were disguised. disguise fails for players and types that can't be summoned.
mcfunction
tma disguise @s minecraft:creeper duration 600
tma disguise @e[type=pig,distance=..10] minecraft:ghast viewers @a[team=red]
tma undisguise @a

/tma global

mcfunction
tma global get <key>
tma global set <key> <value>
tma global delete <key>
tma global list [<prefix>]
tma global prune <prefix>
tma global prune --older-than <ticks>
tma global lock <key> <owner>
tma global unlock <key>

Looks at and changes the global store. Commands ignore locks. A key or prefix without a namespace gets too-many-attributes:.

SubcommandResult
getprints the value. Returns it if it's a whole number, 1/0 for a boolean, the size of a list, and 1 for anything else
setsets or creates the key from a Java literal (5, 2.5, true, "text"). Returns the new value if it's a number, and 1 for anything else
deleteremoves the key. Fails for a missing key
listprints every key (or those starting with <prefix>) with type, value, age, lock owner and bound entities. Returns how many
prune <prefix>deletes every key starting with the prefix. Returns how many
prune --older-than <ticks>deletes every key last written at least that many ticks ago. Returns how many
lock / unlocklocks the key to an owner (a namespace or power id), or removes the lock
mcfunction
tma global set mypack:gate_open true
tma global list mypack:bond/
execute store result score #kills stats run tma global get mypack:zombie_kills

Full details are on page 12.


/tma fakeblock

mcfunction
tma fakeblock set <pos> <block> <viewers> [duration <ticks>]
tma fakeblock fill <from> <to> <block> <viewers> [duration <ticks>]
tma fakeblock clear <pos> [<to>]

Shows the chosen players a different block at <pos>, or at every block in the box from <from> to <to> like /fill. The real block stays as it is. See fake blocks for how players interact with one.

Argument
<pos>the block position. Its chunk must be loaded
<from>, <to>fill, and clear with <to>: two corners of a box, both included. At most 32,768 blocks, the same as /fill. Blocks in unloaded chunks are skipped
<block>what those players see, like minecraft:stone or minecraft:oak_stairs[facing=north]
<viewers>the players who see it. Fixed when the command runs, so they still see it after relogging.
duration <ticks>ticks until it goes away. Left out or 0 lasts until it's cleared or the real block changes
  • Result: set returns how many players it was shown to. fill returns how many fake blocks it placed. clear returns how many fake blocks it removed.
  • Setting one where a fake block already is replaces it.
  • Fake blocks end when the server restarts.
mcfunction
tma fakeblock set ~ ~ ~2 minecraft:bedrock @a[team=red] duration 400
tma fakeblock fill ~-5 ~ ~-5 ~5 ~3 ~5 minecraft:glass @s duration 200
tma fakeblock clear 100 64 -20
tma fakeblock clear ~-5 ~ ~-5 ~5 ~3 ~5

For spheres, cylinders and hollow shapes, use the zone action.


/tma chunkload

mcfunction
tma chunkload start <targets> [radius <radius>] [duration <ticks>]
tma chunkload stop <targets>
tma chunkload list

Ties /forceload-style loading to entities, so it follows them. start is the load_chunks action and stop is stop_loading_chunks. See chunk loading for what's loaded and when it ends.

Argument
<targets>the entities to load around
radius <radius>chunks out from each target's chunk. Default 1 (3×3). 0 is its own chunk.
duration <ticks>ticks until it stops. Left out or 0 lasts until stop, or until the entity dies
  • Result: start returns how many entities it started on. stop returns how many had a tie to stop. list returns how many entities are loading chunks, and prints each one's chunk, dimension, chunk count and ties.
  • It's the same tie as the action. start replaces an existing tie, and stop also ends one the action started. A chunk_loader power keeps going.
  • The ties end when the server restarts.
mcfunction
tma chunkload start @e[type=minecraft:villager,tag=courier]
tma chunkload start @s radius 2 duration 12000
tma chunkload stop @e[tag=courier]

/tma tickrate

mcfunction
tma tickrate <targets> rate <rate> [duration <ticks>]
tma tickrate <targets> freeze [duration <ticks>]
tma tickrate <targets> unfreeze
tma tickrate <targets> step <ticks>
tma tickrate <targets> sprint <ticks>
tma tickrate <targets> reset
tma tickrate <targets> query

Changes how fast entities run. It works like the set_tick_rate action, which explains what slows down.

Subcommand
rate <rate>ticks per second. 20 is normal, 0 stops, up to 100. Players stop at 20
freezestops the targets until unfreeze
unfreezeback to their rate
step <ticks>frozen targets run this many ticks, then stop again
sprint <ticks>targets run at normal speed for this many ticks, then go back
resetback to normal
queryprints the first target's settings
duration <ticks>with rate or freeze: ticks until the targets go back to normal. Left out or 0 lasts until reset
  • Result: the number of targets. query returns the first target's rate, or 0 when it's frozen.
  • unfreeze, step and sprint keep any running duration.
mcfunction
tma tickrate @e[type=zombie,distance=..10] rate 5 duration 200
tma tickrate @p freeze
tma tickrate @p step 20
tma tickrate @e[type=chicken] rate 60
tma tickrate @e reset

/tma keys

mcfunction
tma keys watch [<player>]
tma keys stop

Shows you live, in your action bar, the keybinds the server has for a player (you when left out), and how far each of their action_on_key_sequence powers has got, like combo_dash 1/2. Use it to check that a key reaches the server, or why a sequence doesn't finish.

  • stop ends it. It also ends when you log out.
  • A sequence shows hold <ticks> while a hold step is counting down, and (cooldown) while it can't run.
mcfunction
tma keys watch
tma keys watch Steve
tma keys stop

/tma obfuscate

mcfunction
tma obfuscate <targets> [duration <ticks>] [viewers <viewers>]
tma unobfuscate <targets>

Shows the targets' names (and Styled Nicknames nicknames) as magic text. See name obfuscation for where it applies and what stays visible.

Argument
<targets>the players whose names are scrambled
duration <ticks>ticks until it ends. Left out or 0 lasts until unobfuscate
viewers <viewers>who sees them scrambled. Fixed when the command runs, so they still see it after relogging. Left out: every other player.
  • Result: obfuscate returns how many players it applied to. unobfuscate returns how many had one to end.
  • Running it again on a player replaces the earlier one. An obfuscate_name power keeps going after unobfuscate.
  • It ends when the server restarts.
mcfunction
tma obfuscate @a[team=spies]
tma obfuscate @s duration 1200 viewers @a[team=red]
tma unobfuscate @a

/tma tablist

mcfunction
tma tablist hide <targets> [duration <ticks>] [viewers <viewers>]
tma tablist show <targets>

Leaves the targets out of the tab list. It's the same tie as the hide_from_tablist and show_in_tablist actions. See tab list hiding.

Argument
<targets>the players to leave out
duration <ticks>ticks until they're shown again. Left out or 0 lasts until show
viewers <viewers>whose tab list they're left out of. Fixed when the command runs. Left out: every other player.
  • Result: hide returns how many players it applied to. show returns how many had one to end. A hidden_from_tablist power keeps going.
  • It ends when the server restarts.
mcfunction
tma tablist hide @s
tma tablist hide @a[tag=staff] viewers @a[tag=!staff]
tma tablist show @a

/tma powertag

mcfunction
tma powertag list
tma powertag list <tag>
tma powertag of <power>

Shows what the power tag files resolved to after loading: every tag with how many powers it covers, the powers in one tag, or the tags on one power. Returns the number printed. Write tag names in full (mypack:magic).

mcfunction
tma powertag list mypack:magic
tma powertag of origins:phantomize

/disableshield

mcfunction
disableshield <targets> <ticks>

For each target player who is blocking with a shield right now: lowers the shield, puts shields on cooldown for <ticks>, and plays the shield-break effect. It only affects players who are blocking, which suits an ability like a shield bash.

Argument
<targets>players
<ticks>cooldown length, at least 1
  • Result: how many targets were affected.

Example: a shield-breaking hit, from a power:

json
{
  "type": "origins:action_on_hit",
  "bientity_action": {
    "type": "origins:target_action",
    "action": {
      "type": "origins:execute_command",
      "command": "disableshield @s 100"
    }
  }
}

When you hit a player who is blocking, their shield goes down and can't be raised for 5 seconds.


/tmavc

Voice chat controls. They need Simple Voice Chat to have an effect.

mcfunction
tmavc broadcast start [<listeners>]
tmavc broadcast stop
tmavc mute start <targets>
tmavc mute stop <targets>
tmavc deafen start <targets>
tmavc deafen stop <targets>
SubcommandWhat it does
broadcast startYou (the player running the command) broadcast your voice to every online player, or only to <listeners> if given, until broadcast stop.
broadcast stopEnds your broadcast
mute start / stopForce-mutes the targets, so their microphone audio reaches nobody.
deafen start / stopForce-deafens the targets, so they hear no voice audio.
  • broadcast must be run by a player.
  • Result: broadcast returns 1. mute and deafen return the number of targets.
  • It all ends when the server restarts.

Details, and the matching power actions and conditions, are on page 13.


Gamerules

GameruleDefaultWhat it does
tmaPlayerExpiryDays30Real days a player can be offline before TMA forgets their tracked values and releases global keys bound to them. 0 never forgets. See page 1 and page 12.
whitelistFeedbackemptyOnly the listed players get command feedback.

whitelistFeedback

mcfunction
gamerule whitelistFeedback <username> [<username> …]
gamerule whitelistFeedback none
gamerule whitelistFeedback

A space-separated list of usernames. While it has any names, only those players are sent command feedback. none empties it and restores vanilla behavior. With no value, /gamerule shows the list.

"Command feedback" is what vanilla's sendCommandFeedback gamerule covers:

  • the message a player gets from their own command, like Set the time to 1000
  • the gray, italic [Steve: Set the time to 1000] copy sent to other operators, including the ones from command blocks when commandBlockOutput is on

Unchanged:

  • Error messages (red) go to whoever ran the command, as with sendCommandFeedback.
  • With sendCommandFeedback false, nobody gets feedback. This gamerule only narrows who gets it.
  • The server console and log get everything.
  • Output a command sends on purpose, like /tell, /say, /tellraw or /title, reaches its targets as usual.
  • Result: setting it returns how many names are on the list.
  • Names are usernames and ignore case. An offline name stays on the list and applies when they join.
  • It's saved with the world, like any gamerule.
  • Careful: setting it without your own name stops your own feedback, starting with the confirmation of that /gamerule command.
mcfunction
gamerule whitelistFeedback Notch jeb_
gamerule whitelistFeedback none