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!
===Selecting targets by item=== {{exclusive|bedrock|section=yes}} :Filter target selection based on whether the entity has the specified items. The given values must be enclosed by square brackets or braces. Cannot duplicate this argument, but multiple items can be specified with square brackets. :<code>[hasitem={<''argument''>=<''value''>,<''argument2''>=<''value2''>,...}]</code> β Include only targets that have the specified items. :<code>[hasitem=[{<''argumentA''>=<''valueA''>,...},{<''argumentB''>=<''valueB''>,...}]]</code> β Include only targets that have item A and item B, etc. : All acceptable arguments are as follows: :*<code>item</code> :*:Must be an item ID. :*<code>data</code> :*:Specifies the item data for the item(s). Must be a 32-bit integer number. Values which are invalid for the specified item id will default to 0. If not specified, defaults to 0. :*:Note that because it defaults to 0, selectors like <code>{item=potion}</code> can only target water bottle, though <code>{item=potion,data=1}</code> can target mundane potion. :*:Currently dosen't work on blocks' direct item forms (e.g. dirt, stone). For these items, <code>data</code> is always considered as invalid and defaults back to 0, and aux value of these items in inventory are also always considered as 0. That means you can't target items like coarse dirt, green wool solely. :*:For potion and tipped arrow, aux value represents the data value of potion effect, and currently invalid values crash the game. :*<code>quantity</code> :*:Specifies the amount of the items the entity has. Must be an integer range (e.g. <code>1</code> - exact match of 1. <code>..5</code> - less than or equal to 5. <code>5..</code> - more than or equal to 5. <code>0..5</code> - between 0 and 5, inclusive.). :*:<code>!</code> can be uesd to invert selection. For example, <code>{item=apple,quantity=!5}</code> can exclusive entities who have five apples. :*:When not specified, defaults to <code>quantity=1..</code>. When <code>quantity=0</code>, entities must have 0 the specified item (i.e. do not have the specified item) to be targeted. :*<code>location</code> and <code>slot</code> :*:Specifies the inventory slot to test. See [[Slot]] for details. :*:Specifying <code>slot</code> without <code>location</code> is invalid. :*:<code>slot</code> must be an integer range. (e.g. <code>1</code> - exact match of 1. <code>..5</code> - less than or equal to 5. <code>5..</code> - more than or equal to 5. <code>0..5</code> - between 0 and 5, inclusive.) {{anchor|Selecting targets by permission}}
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