<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mutigeraffe.com/index.php?action=history&amp;feed=atom&amp;title=AnotherBackpackContent%3AModding_API</id>
	<title>AnotherBackpackContent:Modding API - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mutigeraffe.com/index.php?action=history&amp;feed=atom&amp;title=AnotherBackpackContent%3AModding_API"/>
	<link rel="alternate" type="text/html" href="https://wiki.mutigeraffe.com/index.php?title=AnotherBackpackContent:Modding_API&amp;action=history"/>
	<updated>2026-10-19T20:55:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.mutigeraffe.com/index.php?title=AnotherBackpackContent:Modding_API&amp;diff=2472&amp;oldid=prev</id>
		<title>Maintenance script: AnotherBackpackContent wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.mutigeraffe.com/index.php?title=AnotherBackpackContent:Modding_API&amp;diff=2472&amp;oldid=prev"/>
		<updated>2026-10-19T13:44:57Z</updated>

		<summary type="html">&lt;p&gt;AnotherBackpackContent wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Other mods can find the backpacks a player carries and move items into or out of them. [[AnotherBackpackContent:Better Storage|Better Storage]] uses this for its Backpacks box.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The public API is the class &amp;lt;code&amp;gt;com.cyberpiratepenguin.anotherbackpackcontent.api.BackpackAPI&amp;lt;/code&amp;gt;. Everything outside the &amp;lt;code&amp;gt;api&amp;lt;/code&amp;gt; package is internal and may change in any version.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Member !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;API_VERSION&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, currently &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Goes up with every new method. Existing methods stay.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isBackpack(ItemStack stack)&amp;lt;/code&amp;gt; || Whether the stack is a backpack from this mod.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;backpacks(Ref&amp;amp;lt;EntityStore&amp;amp;gt; player, ComponentAccessor&amp;amp;lt;EntityStore&amp;amp;gt; accessor)&amp;lt;/code&amp;gt; || The contents of every backpack the player carries, as a &amp;lt;code&amp;gt;List&amp;amp;lt;ItemContainer&amp;amp;gt;&amp;lt;/code&amp;gt;, in the order hotbar, inventory, backpack slots, utility slot.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Using the containers ==&lt;br /&gt;
* Each container carries the filter of its backpack. &amp;lt;code&amp;gt;addItemStack&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;moveItemStackFromSlot&amp;lt;/code&amp;gt; only let in what belongs there.&lt;br /&gt;
* Every change is written into the backpack item right away. You don&amp;#039;t need to save anything.&lt;br /&gt;
* The containers are the same instances an open backpack window and the auto-pickup use, so writing to them at the same time doesn&amp;#039;t overwrite anything.&lt;br /&gt;
* Call the API from the &amp;#039;&amp;#039;&amp;#039;world thread&amp;#039;&amp;#039;&amp;#039; only.&lt;br /&gt;
&lt;br /&gt;
== Depending on the mod ==&lt;br /&gt;
The signatures in &amp;lt;code&amp;gt;BackpackAPI&amp;lt;/code&amp;gt; are stable. To keep your mod working without Another Backpack Content, call the API through reflection, the way Better Storage does, and list the mod as an optional dependency in your manifest:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;OptionalDependencies&amp;quot;: {&lt;br /&gt;
    &amp;quot;com.cyberpiratepenguin:anotherbackpackcontent&amp;quot;: &amp;quot;*&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check &amp;lt;code&amp;gt;API_VERSION&amp;lt;/code&amp;gt; before you call a method that was added later.&lt;br /&gt;
&lt;br /&gt;
== Item IDs ==&lt;br /&gt;
Backpack IDs follow the scheme &amp;lt;code&amp;gt;ABC_Backpack_&amp;amp;lt;Kind&amp;amp;gt;_&amp;amp;lt;Size&amp;amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
* Kind: &amp;lt;code&amp;gt;Miner&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Digger&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Forester&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Hunter&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Builder&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Adventurer&amp;lt;/code&amp;gt;&lt;br /&gt;
* Size: &amp;lt;code&amp;gt;Small&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Medium&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Big&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example &amp;lt;code&amp;gt;ABC_Backpack_Hunter_Big&amp;lt;/code&amp;gt;. All backpacks carry the tags &amp;lt;code&amp;gt;Type: Utility&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Family: Backpack&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{AnotherBackpackContent Nav}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>