InfiniteBags | Backpack with Shop 1.3.0

Unlimited per-item storage with a built-in shop hook to sell straight from your bag.

1.3.0

Latest
All versions
Download 0
No ratings yet

Compatibility

Minecraft: Java Edition 1.21 - 1.21.11
Platforms Paper Spigot Purpur

Changes

InfiniteBags v1.3.0
Two new API methods, so another plugin can read what a bag holds and take items back out of it.

🔌 Reading and Removing

Until now the developer API could only put items into a bag. These two methods let another plugin on your server take them back out, which is what makes a bag usable as a live source of blocks or materials rather than just storage.

long count(UUID player, ItemStack item)
int remove(UUID player, ItemStack item)
  • count returns how many of that item type the bag holds. The amount on the item you pass in is ignored. It returns a long, because a well-stocked bag can hold more of one type than an int can express
  • remove takes items of that type back out, with the amount on the item you pass in being the quantity to take. It returns how many were actually removed

✂️ Removal Is Partial, On Purpose

Unlike add, which is all or nothing, remove takes what is there. Ask for 5 against a bag holding 3 and you get 3 taken and 3 returned, so the caller can cover the shortfall itself. The return value is always between 0 and the amount you asked for, never more.

A slot drained to zero is deleted rather than left sitting empty, so it frees up for a different item type straight away.


📌 Worth Knowing

  • Same grouping as the rest of the API (material plus full NBT hash), so count(...) > 0 is exactly equivalent to contains(...). A renamed or enchanted block is a different type and is never consumed to satisfy a request for the plain one
  • Both work offline and are locked per player, like the rest of the API. They are async-safe, touching only the database and in-memory data
  • Neither runs a permission check internally. Call isEnabled(uuid) yourself if you want that gate
  • Both see items on pages or slots the player's current permissions no longer reach, the ones /bag recover exposes, so everything count reports is something remove can actually hand over
  • Null or air items, and null UUIDs, return 0. No exceptions
  • Calling the API by reflection is supported and now documented

📦 Install

Stop the server, replace the old jar in plugins/ with InfiniteBags-1.3.0.jar, and start it again. No existing method changed behaviour and the storage is untouched, so your bags carry over exactly as they are and anything already built against the API keeps working unchanged.


Need help or found a bug? Join the Discord.
Join the Discord

Enjoying the plugin? A ⭐ review goes a long way!

Dependencies

InfiniteBags-1.3.0.jar 225.95 KB
Purchase required
Product Info
Statistics
57

Views

0

Purchases

0

Downloads

225.95 KB

File size

10.06.2026

Published

17.08.2026

Updated

Info
Supported software
Supported Versions
1.21 - 1.21.11
Share & Earn

Share and earn part of the profits, an estimated €0.5 per product sale.

Log in to get your link
Product Image
InfiniteBags | Backpack with Shop
InfiniteBags | Backpack with Shop