Minecraft:Commands/compute: Difference between revisions
From SAS Gaming Wiki
More actions
Sync: new page from Minecraft |
Sync: updated from Minecraft |
||
| Line 5: | Line 5: | ||
|oplevel = 2 | |oplevel = 2 | ||
}} | }} | ||
Evaluates [[Minecraft:number provider]]s in various contexts. | |||
== Syntax == | == Syntax == | ||
: {{cmd|compute <CONTEXT> <provider> [<scale>{{!}}integer]}} | |||
: Where {{cd|CONTEXT}} is one of: | |||
:: {{cd|default}} | |||
::: Run provider with the [[Minecraft:Loot context#minecraft:command_compute_default|{{cd|minecraft:command_compute_default}}]] context, only providing common parameters (execution position and {{cd|this}} entity). | |||
:: {{cd|block <pos>}} | |||
::: Run provider with the [[Minecraft:Loot context#minecraft:command_compute_position|{{cd|minecraft:command_compute_position}}]] context, providing block state and block entity based on the block at {{cd|<pos>}}. | |||
:: {{cd|entity <target>}} | |||
::: Run provider with the [[Minecraft:Loot context#minecraft:command_compute_entity|{{cd|minecraft:command_compute_entity}}]] context, providing {{cd|target_entity}} based on the selector result. | |||
: If {{cd|[<scale>{{!}}integer]}} is set to a number or omitted, the number provider is evaluated in float mode. | |||
: If it is set to {{cd|integer}}, the number provider is evaluated in integer mode, truncating after every step. | |||
== Arguments == | |||
{{expand section}} | {{expand section}} | ||
== | {{argument|pos|block_pos}} | ||
{{ | : Specifies a block that will be available to the number provider. | ||
: {{arg desc|je=block_pos}} | |||
{{argument|target|entity}} | |||
: Specifies an entity that will be available to the number provider. | |||
: {{arg desc|je=entity|amount=single|type=entities}} | |||
{{argument|provider|number_provider}} | |||
: Specifies the [[Minecraft:number provider]] to evaluate. | |||
: {{arg desc|je=number_provider}} | |||
{{argument|scale|float}} | |||
: The result of the provider will be scaled by this value and rounded towards negative infinity for command output. | |||
: {{arg desc|je=float}} | |||
== Result == | == Result == | ||
Revision as of 11:10, 27 August 2026
Template:Wip Template:In development Template:Infobox command
Evaluates Minecraft:number providers in various contexts.
Syntax
- Template:Cmd
- Where Template:Cd is one of:
- Template:Cd
- Run provider with the [[Minecraft:Loot context#minecraft:command_compute_default|Template:Cd]] context, only providing common parameters (execution position and Template:Cd entity).
- Template:Cd
- Run provider with the [[Minecraft:Loot context#minecraft:command_compute_position|Template:Cd]] context, providing block state and block entity based on the block at Template:Cd.
- Template:Cd
- Run provider with the [[Minecraft:Loot context#minecraft:command_compute_entity|Template:Cd]] context, providing Template:Cd based on the selector result.
- Template:Cd
- If Template:Cd is set to a number or omitted, the number provider is evaluated in float mode.
- If it is set to Template:Cd, the number provider is evaluated in integer mode, truncating after every step.
Arguments
- Specifies a block that will be available to the number provider.
- Template:Arg desc
- Specifies an entity that will be available to the number provider.
- Template:Arg desc
- Specifies the Minecraft:number provider to evaluate.
- Template:Arg desc
- The result of the provider will be scaled by this value and rounded towards negative infinity for command output.
- Template:Arg desc