<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetSingleItem</id>
	<title>API:GetSingleItem - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetSingleItem"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetSingleItem&amp;action=history"/>
	<updated>2026-10-18T04:53:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetSingleItem&amp;diff=30466&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetSingleItem&amp;diff=30466&amp;oldid=prev"/>
		<updated>2026-10-16T19:45:01Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Item}}&lt;br /&gt;
Returns the data of the item in one slot of one item location.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
item = GetSingleItem(location, slot, includeEmpty)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;location : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – A &amp;lt;code&amp;gt;GameData.ItemLocs&amp;lt;/code&amp;gt; value. See the table below.&lt;br /&gt;
;slot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Slot inside that location, starting at 1.&lt;br /&gt;
;includeEmpty : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to get a table even when the slot is empty.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;item : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – An [[API:GetInventoryItemData#Item data table|item data table]], or nothing (see Details).&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Accepted locations and the highest slot number the client accepts for each:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Location !! Value !! Highest slot&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GameData.ItemLocs.EQUIPPED&amp;lt;/code&amp;gt; || 2 || 27&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GameData.ItemLocs.INVENTORY&amp;lt;/code&amp;gt; || 3 || 80&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GameData.ItemLocs.BANK&amp;lt;/code&amp;gt; || 4 || 241&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GameData.ItemLocs.QUEST_ITEM&amp;lt;/code&amp;gt; || 9 || 65&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GameData.ItemLocs.INVENTORY_OVERFLOW&amp;lt;/code&amp;gt; || 20 || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GameData.ItemLocs.CRAFTING_ITEM&amp;lt;/code&amp;gt; || 30 || 80&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GameData.ItemLocs.CURRENCY_ITEM&amp;lt;/code&amp;gt; || 31 || 132&lt;br /&gt;
|}&lt;br /&gt;
* Nothing is returned when the location is not in the table, when &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; is 0 or above the limit, or when the slot is empty and &amp;lt;code&amp;gt;includeEmpty&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
* With &amp;lt;code&amp;gt;includeEmpty = true&amp;lt;/code&amp;gt; an empty slot gives a table with default values (&amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; 0, empty &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;).&lt;br /&gt;
* For &amp;lt;code&amp;gt;INVENTORY_OVERFLOW&amp;lt;/code&amp;gt; the &amp;lt;code&amp;gt;slot&amp;lt;/code&amp;gt; argument is ignored: the client picks the slot from the overflow contents itself. [[API:GetOverflowData|GetOverflowData]] is the function the stock UI uses for the overflow.&lt;br /&gt;
* The limits are the client&amp;#039;s upper bounds. They are larger than the number of slots a player normally has, so check the slot count yourself.&lt;br /&gt;
* &amp;lt;code&amp;gt;includeEmpty&amp;lt;/code&amp;gt; must be a real boolean. Passing &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt; or a number raises an &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; error.&lt;br /&gt;
* The function needs at least three arguments and only reads the last three.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument has the wrong type.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Refreshing one bank slot, from &amp;lt;code&amp;gt;default/ea_bankwindow/source/bankwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local itemData  = GetSingleItem( GameData.ItemLocs.BANK, slot, false )&lt;br /&gt;
&lt;br /&gt;
BankWindow.items[slot] = itemData&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetInventoryItemData|GetInventoryItemData]]&lt;br /&gt;
* [[API:GetBankData|GetBankData]]&lt;br /&gt;
* [[API:GetEquipmentData|GetEquipmentData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>