Origins: Powerful Powers
» CommandsPage 15 of 17

Commands

Every OPP 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
/opp with <targets> <command>runs a command with ${…} filled in from each target's variables
/opp powerinv …reads and writes origins:inventory power slots
/opp fakeentity …spawns, lists and removes fake entities only chosen players can see
/opp disguise …, /opp undisguise …makes entities look like another entity type
/opp global …looks at and changes the global store
/opp fakeblock …shows chosen players a different block at a position
/opp chunkload …keeps the chunks around an entity loaded, following it
/opp obfuscate …, /opp unobfuscate …shows players' names as magic text to chosen viewers
/opp tablist hide|show …leaves players out of chosen viewers' tab list
/opp powertag …shows which powers a tag covers
/disableshield <targets> <ticks>knocks down a raised shield and puts it on cooldown
/oppvc …voice chat: broadcast, forced mute, forced deafen

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


/opp with

mcfunction
opp 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
opp with @a title @s actionbar {"text":"${coins} coins"}
opp with @s scoreboard players set @s level ${(int) (xp / 100)}

Full details are on page 9.


/opp powerinv

mcfunction
opp powerinv get   <target> <power> <slot>
opp powerinv id    <target> <power> <slot>
opp powerinv set   <target> <power> <slot> <item> [count]
opp powerinv clear <target> <power> [slot]
opp powerinv copy  <from> <to>
opp 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.


/opp fakeentity

mcfunction
opp fakeentity spawn  <owner> <entity_type> <pos> <lifetime> [behavior <behavior>] [viewers <viewers>] [id <id>]
opp fakeentity player <owner> <username> <pos> <lifetime> [behavior <behavior>] [viewers <viewers>] [id <id>]
opp fakeentity remove <id>
opp fakeentity run <id> <command>
opp fakeentity remove-all <owner>
opp 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 opp 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 opp fakeentity spawn @s minecraft:zombie ^ ^ ^8 200 behavior hostile viewers @s
opp fakeentity player @s Notch ~ ~ ~2 400 id 50 viewers @s
opp fakeentity run 50 effect give @s minecraft:glowing 5
opp fakeentity remove 50
opp 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 /opp with:

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

/opp disguise

mcfunction
opp disguise <targets> <entity_type> [duration <ticks>] [viewers <viewers>]
opp 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
opp disguise @s minecraft:creeper duration 600
opp disguise @e[type=pig,distance=..10] minecraft:ghast viewers @a[team=red]
opp undisguise @a

/opp global

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

Looks at and changes the global store. Commands ignore locks. A key or prefix without a namespace gets origins-powerful-powers:.

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
opp global set mypack:gate_open true
opp global list mypack:bond/
execute store result score #kills stats run opp global get mypack:zombie_kills

Full details are on page 12.


/opp fakeblock

mcfunction
opp fakeblock set <pos> <block> <viewers> [duration <ticks>]
opp fakeblock clear <pos>

Shows the chosen players a different block at <pos>. 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
<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. clear returns 1 if a fake block was there, and 0 if none was.
  • Setting one where a fake block already is replaces it.
  • Fake blocks end when the server restarts.
mcfunction
opp fakeblock set ~ ~ ~2 minecraft:bedrock @a[team=red] duration 400
opp fakeblock clear 100 64 -20

/opp chunkload

mcfunction
opp chunkload start <targets> [radius <radius>] [duration <ticks>]
opp chunkload stop <targets>
opp 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
opp chunkload start @e[type=minecraft:villager,tag=courier]
opp chunkload start @s radius 2 duration 12000
opp chunkload stop @e[tag=courier]

/opp obfuscate

mcfunction
opp obfuscate <targets> [duration <ticks>] [viewers <viewers>]
opp 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
opp obfuscate @a[team=spies]
opp obfuscate @s duration 1200 viewers @a[team=red]
opp unobfuscate @a

/opp tablist

mcfunction
opp tablist hide <targets> [duration <ticks>] [viewers <viewers>]
opp 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
opp tablist hide @s
opp tablist hide @a[tag=staff] viewers @a[tag=!staff]
opp tablist show @a

/opp powertag

mcfunction
opp powertag list
opp powertag list <tag>
opp 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
opp powertag list mypack:magic
opp 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.


/oppvc

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

mcfunction
oppvc broadcast start [<listeners>]
oppvc broadcast stop
oppvc mute start <targets>
oppvc mute stop <targets>
oppvc deafen start <targets>
oppvc 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
oppPlayerExpiryDays30Real days a player can be offline before OPP 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