Item Filters: Difference between revisions

Jump to navigation Jump to search
710 bytes added ,  04:26, 5 November 2022
→�: - updated for examples
(Fix typo)
(→�: - updated for examples)
 
Line 1: Line 1:
Item filters can be used to reduce the size of a list of items. Current commands that support them are <code>/items</code>, <code>/inv</code>, <code>/g inv</code> and <code>/recipe</code>. These commands have a <code>filter:</code> argument which accept an item filter.
Item filters can be used to reduce the size of a list of items. Current commands that support them are <code>/items</code>, <code>/inv</code>, <code>/g inv</code> and <code>/recipe</code>. These commands have a <code>filter:</code> argument which accept an item filter.


== Properties ==
==Properties==


{| class="wikitable"
{| class="wikitable"
! Property
!Property
! width="500px" | Acceptable values
! width="500px" |Acceptable values
! width="250px" | Examples
! width="250px" |Examples
|-
|-
| name
|name
| The item name
|The item name
|
|<code>iron</code>
|-
|-
| level
|level
| The item level
|The item level
|
|<code>level:1</code>
<br />
|-
|-
| cost
|cost
| The buying price of the item; unbuyable items have a cost of -1
|The buying price of the item; unbuyable items have a cost of -1
|
|<code>cost:1000</code>
|-
|-
| type
|type
| The type of the item shown in <code>/items</code>
|The type of the item shown in <code>/items</code><nowiki>Properties: weapon | helm | boots | chest | ring | necklace | | potion | ore | log | sapling | book | effectpotion | trophy | gem | rune | dummy </nowiki>
|
|<code>type:necklace</code>
|-
|-
| toolType
|toolType
| The type of tools shown in <code>/items</code>
|The type of tools shown in <code>/items</code><nowiki>Properties: axe | pickaxe | shears | fishingRod</nowiki>
|
|<code>toolType:axe</code>
|-
|-
| sell
|sell
| The selling price of the item
|The selling price of the item
|
|<code>sell:1000</code>
|-
|-
| sellable
|sellable
| true or false value showing if an item can be sold
|true or false value showing if an item can be sold
|
|<code>sellable:true</code>
|-
|-
| tradable
|tradable
| true or false value showing if an item can be traded
|true or false value showing if an item can be traded
|
|<code>tradable:true</code>
|-
|-
| desc
|desc
| The item's description
|The item's description
|
|<code>desc:dummy</code>
|-
|-
| forage
|forage
| true or false value of if the item can be foraged
|true or false value of if the item can be foraged
|
|<code>forage:true</code>
|-
|-
| foragedata
|foragedata
| Either Object or undefined; same as forage but includes Magic Saplings
|Either Object or undefined; same as forage but includes Magic Saplings
|
|<code>foragedata:</code>
|-
|-
| ore
|ore
| Either Object or undefined; same items as type:ore
|Either Object or undefined; same items as type:ore
|
|<code>ore:</code>
|-
|-
| fish
|fish
| Either Object or undefined; same as type:fish
|Either Object or undefined; same as type:fish
|
|<code>fish:</code>
|-
|-
| plural
|plural
| The plural name of the object
|The plural name of the object
|
|<code>plural:apples</code>
|-
|-
| prefix
|prefix
| The grammatical prefix of the object; usually <code>a</code> or <code>an</code>
|The grammatical prefix of the object; usually <code>a</code> or <code>an</code>
|
|<code>prefix:an</code>
|-
|-
| attributes
|attributes
| Either Object or undefined; whether or not the object boosts any attributes
|Either Object or undefined; whether or not the object boosts any attributes
|
|<code>attributes:</code>
|-
|-
| def
|def
| The percentage of damage blocked by the armor (or undefined)
|The percentage of damage blocked by the armor (or undefined)
|
|<code>def:10</code>
|-
|-
| id
|id
| The ID of the item; normally a number. Meta items are <code>m:number</code>
|The ID of the item; normally a number. Meta items are <code>m:number</code>
|
|<code>id:1</code>
|-
|-
| itemBoost
|itemBoost
| The amount of extra items received when doing sides with this tool
|The amount of extra items received when doing sides with this tool
|
|<code>itemBoost:</code>
|-
|-
| skillXp
|skillXp
| The static boost to skill xp granted by Jades in tools
|The static boost to skill xp granted by Jades in tools
|
|<code>skillXp:</code>
|-
|-
| gems
|gems
| The enchantments on an item; is a string like JJ for 2 Jades
|The enchantments on an item; is a string like JJ for 2 Jades
|
|<code>gems:J</code>
|-
|-
| sockets
|sockets
| The number of gem sockets on an item: 1, 2, or undefined
|The number of gem sockets on an item: 1, 2, or undefined
|
|<code>sockets:1</code>
|-
|-
| enchants
|enchants
| An array of enchantments in the form [sx;4,as;10] (don't try to use this; just use gems)
|An array of enchantments in the form [sx;4,as;10] (don't try to use this; just use gems)
|
|<code>enchants:sx;4</code>
|-
|-
| suffix
|suffix
| The end of the name on meta items, such is 2SRR+23
|The end of the name on meta items, such is 2SRR+23
|
|<code>suffix:2SRR+23</code>
|}
|}


=== Specific to /recipe ===
===Specific to /recipe===
These properties can only be used in /recipe:
These properties can only be used in /recipe:


{| class="wikitable"
{| class="wikitable"
! Property
!Property
! width="500px" | Acceptable values
! width="500px" |Acceptable values
! width="250px" | Examples
! width="250px" |Examples
|-
|-
| canCraft
|canCraft
|true or false value showing if you're allowed to craft that item; the gray items in the list are false
|true or false value showing if you're allowed to craft that item; the gray items in the list are false
|  
|
|-
|-
| hasMats  
|hasMats
| true or false value showing if you have the materials to craft that item right then
|true or false value showing if you have the materials to craft that item right then
|
|
|-
|-
| level
|level
| Specifies the crafting level instead of the item level
|Specifies the crafting level instead of the item level
|
|
|-
|-
| uses  
|uses
| Item name or item ID used in the crafting recipe; this isn't a property so much as a special search
|Item name or item ID used in the crafting recipe; this isn't a property so much as a special search
|
|
|}
|}


== Examples ==
==Examples==


*To get the list of buyable weapons under level 100:
*To get the list of buyable weapons under level 100:
<code>/items filter:type:weapon cost:>:0 level:<=:100</code>
<code>/items filter:type:weapon cost:>:0 level:<=:100</code>
*To get all the ores in your inventory:
*To get all the ores in your inventory:
<code>/inv view filter:type:ore</code>
<code>/inv view filter:type:ore</code>
*To get items in your inv that give boosts to attributes:
*To get items in your inv that give boosts to attributes:
<code>/inv view filter:attributes:</code>
<code>/inv view filter:attributes:</code>
*To get the list of non-donor items:
*To get the list of non-donor items:
<code>/items filter:donate:undefined donator:undefined</code>
<code>/items filter:donate:undefined donator:undefined</code>
*To get (most of) the list of donor items:
*To get (most of) the list of donor items:
<code>/items filter:donate:true</code>
<code>/items filter:donate:true</code>
*To get all the recipes that use coal anywhere in the crafting tree:
*To get all the recipes that use coal anywhere in the crafting tree:
<code>/recipe filter:uses:coal --raw</code>
<code>/recipe filter:uses:coal --raw</code>
*To get the list off all axe's tool type in items
*To get the list off all axe's tool type in items
<code>/items filter:toolType:axe</code>
<code>/items filter:toolType:axe</code>


== Notes ==
==Notes==


*Not all items can use all properties. For example, not all items have an <code>ore</code> field, so if you search <code>/items filter:ore:</code>, any items without <code>ore</code> data will be filtered out.
*Not all items can use all properties. For example, not all items have an <code>ore</code> field, so if you search <code>/items filter:ore:</code>, any items without <code>ore</code> data will be filtered out.

Navigation menu