Wiki 9Minecraft Bag Of Yurting Wiki
Bag Of Yurting WikiDocumentation › Bag Of Yurting

Bag Of Yurting

The Bag of Yurting item can be used to store a cubic section of blocks, and unload them elsewhere.

Contents
  1. Obtaining
    1. Crafting Recipes
      1. Basic Bag
      2. Dyeing
  2. Upgrading
  3. Usage
    1. Creative Power
  4. Data
    1. Itemstack Data
    2. World Data
  5. History

Obtaining

Crafting Recipes

Basic Bag

A bag capable of storing a single block can be created using wool and an ender pearl.

Dyeing

Bags of Yurting can be dyed in the same manner as leather pants.

Dyed bags can be crafted with additional dyes to dye them further, and can be undyed by using the bag on a cauldron of water.

Upgrading

Two bags of the same size can be crafted together to create a bag one tier higher; two one-block bags become a 3x3x3 bag, two 3x3x3 bags become a 5x5x5 bag, etc.

Be aware that this will destroy any block data contained within the bags; make sure to unload any block data before upgrading bags.

If one of the ingredient bags is died, the new bag will retain its color. If both bags are dyed, the new bag will use a blend of the two previous colors.

Usage

Using an empty bag on a block in the world will attempt to store a cubic section of the world into the bag, according to the bag's size tier. The block that the bag is used on will be the bottom-center of the area of effect.

Ordinary players have restrictions on what blocks can be stored according to the blacklist and whitelist block tags. Blocks that the player is not allowed to store will be ignored. Additionally, a forge BreakEvent is fired for each block; cancellation of this event by another mod will prevent the block from being stored or removed.

When the bag has block data stored, it will glow with an enchanted-item glint to indicate that the bag is storing data.

Using a full bag on a block will attempt to unload the bag's contents into the world, with the empty block against the activated block being the bottom-center of the unloading zone. Unloaded blocks will be reoriented according to the player's facing. If the player is not using the bag with creative power, then unloading will fail if any non-replaceable blocks are in the way of the bag's contents. Additionally, a forge EntityMultiPlaceEvent is fired for the blocks being placed; cancellation of this event by another mod will cause the unloading to fail, and contents will remain in the bag.

Creative Power

A player who is in creative mode or has permission from the server to use the bag with Creative Power outside of creative mode can hold the sprint key to use the bag with Creative Power. When the bag is being used with Creative Power, block restrictions are ignored; any block can be stored in the bag (even if the block is in the blacklist tag), and unloading the bag will always succeed, replacing any existing blocks in the area.

Even with Creative Power enabled, cancellation of the break event or place events will still cause the load or unload to fail.

Players can invert the keybind using the client config; if the keybind is inverted, players with creative permissions will always use the bag with Creative Power, unless the sprint key is held, in which case they will use the bag with normal-player restrictions instead.

Data

Item Item ID Localization Key
Bag of Yurting bagofyurting:bag_of_yurting item.bagofyurting.bag_of_yurting
Item Properties Value
Stack Limit 1
Durability No
Creative Tab Tools

Itemstack Data

To minimize the amount of data needing to be copied when itemstacks are moved around, the actual block data stored "in" bags of yurting is stored separately in the world folder; the bag of yurting itemstack only holds a UUID referring to the file where the block data is stored.

<root>
{
	"radius": <integer>, // size tier of the bag; 1x1x1 = 0, 3x3x3 = 1, 5x5x5 = 2, etc
	"yurtdata_id": <optional-string>, // uuid of data file in world data, present if data is being stored here
	"display": // optional object present on dyed bags
	{
		"color": <int> // RGB color integer of the bag's dye color
	}
}

World Data

Block data for filled bags of yurting is stored in /bagofyurting. These are NBT data files are named .dat, where is an identifier matching a uuid in the itemstack data of a filled bag of yurting. A new UUID is randomly generated whenever a bag of yurting is used to store block data.

These data files have the following format:

{
	"data": // list of positional info objects, one for each position stored in the data
	[
		{
			"state": <int>, // index in the blockstate palette list, indicating which state is stored at this position
			"pos": [x,y,z], // list of three integers indicating the relative position of this block relative to the yurting origin
			"nbt": <optional-object> // NBT object storing blockentity data, if the block had any blockentity data to store
		}
		// more objects . . .
	],
	"states": // the blockstate palette list, storing one blockstate object for each unique blockstate in the stored data
	[
		{<standard-format blockstate object>}
		// more blockstates . . .
	]
}

History

Version Changelog
1.16.4-1.2.0.0 Added new world-folder storage by alesharik, block data is no longer stored in itemstacks; the new data format also uses a blockstate-palette to reduce size on disk for large blobs of data with chunky blockstates
1.0.0.0 Added to game