Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/compute: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: new page from Minecraft
 
SyncBot (talk | contribs)
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}}
: {{cmd|compute <target> <provider> [<scale>{{!}}integer]}}


== Arguments ==
{{argument|pos|block_pos}}
{{Empty section}}
: 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.
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

Template:Expand section

Template:Argument

Specifies a block that will be available to the number provider.
Template:Arg desc

Template:Argument

Specifies an entity that will be available to the number provider.
Template:Arg desc

Template:Argument

Specifies the Minecraft:number provider to evaluate.
Template:Arg desc

Template:Argument

The result of the provider will be scaled by this value and rounded towards negative infinity for command output.
Template:Arg desc

Result

Template:Empty section

Output

Template:Empty section

History

Template:HistoryTable

Navigation

Template:Navbox new content Template:Navbox commands

Minecraft:zh:命令/compute