Editing
Target selectors
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Limiting and sorting target selection=== : Limit the number of selectable targets for a target selector. : When using the variables <code>@p</code> and <code>@r</code>, this argument defaults to one. Applying the limiting argument to them may increase the number of nearest or random targets selected. When applying this argument to <code>@a</code> or <code>@e</code>, this argument returns only a limited number of targets. Cannot duplicate these arguments. : {{IN|java}}: <code>[limit=<value>,sort=(nearest|furthest|random|arbitrary)]</code> β Limit the number of targets, and specify selection priority. :*<code>sort=nearest</code> β Sort by increasing distance. (Default for <code>@p</code>) :* <code>sort=furthest</code> β Sort by decreasing distance. :* <code>sort=random</code> β Sort randomly. (Default for <code>@r</code>) :* <code>sort=arbitrary</code> β Do not sort. This will often return the oldest entities first due to how the game stores entities internally, but no order is guaranteed. (Default for <code>@e</code>, <code>@a</code>) : {{IN|bedrock}}: <code>[c=<value>]</code> β Limit the number of targets. : For <code>@p</code>, <code>@a</code>, and <code>@e</code>, <code>[c=<value>]</code> selects only the specified number of targets by increasing distance from the selector's position. When <code>c</code> is negative, it will reverse the order of targeting (for example, <code>@p[c=-1]</code> will target the furthest player). Inverse sorting does not work with <code>@r</code>. : Examples {{in|java}}: :* <code>@a[limit=3,sort=nearest]</code> or <code>@p[limit=3]</code> β Select the nearest three players. :* <code>@a[limit=4,sort=furthest]</code> β Select the furthest four players. :* <code>@a[limit=2,sort=random]</code> or <code>@r[limit=2]</code> β Select two players, chosen randomly. : Examples {{in|bedrock}}: :* <code>@a[c=3]</code> β Select the nearest three players. :* <code>@a[c=-4]</code> β Select the furthest four players. :* <code>@r[c=2]</code> β Select two living players, chosen randomly.
Summary:
Please note that all contributions to Kiiw may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Kiiw:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information