[Suggestion] `/clayout`
Requirement
- Not in spectator mode
Syntax
/clayout (create|edit) block <x> <y> <z> <item_slot> <name>
/clayout (create|edit) entity <entity> <item_slot> <name>
/clayout (delete|preview) <name>
/clayout load <name> [--drop-new-item]
/clayout list
Arguments
item_slot
Must be a string notation that refers to certain slots in the inventory.
| Slot | Valid slot_child && slot_number |
|---|---|
| armor | |
| armor.slot_child | head, chest, legs, feet |
| weapon | |
| weapon.slot_child | mainhand, offhand |
| container | |
| container.slot_child | 0 - 53 |
| enderchest | |
| enderchest.slot_child | |
| hotbar | |
| hotbar.slot_child | |
| inventory | |
| inventory.slot_child | |
| horse | |
| horse.slot_child | saddle, chest, armor, 0 - 14 |
| ~~villager~~ | |
| ~~vilalger.slot_child~~ | ~~0 - 7~~ |
name
Optional. The name of the layout
Description
create : Create a new layout from the items in item_slot
edit : Edits a layout, replacing items in the layout with the items in item_slot
delete : Deletes an existing layout.
preview : Displays a item_slot with the items contained in the layout.
load : Load a layout, new item (an item that not in the layout) will be ignored
load --drop-new-item : Load a layout, new item (an item that not in the layout) will be dropped
Data
The data will be stored at .minecraft\config\clientcommands\layout.dat (Its also has the dat_old version for backup). And the structure looks like this (SNBT Format, Just like group.dat and kits.dat) :
{
"DataVersion": <data_version>,
"Layout": {
"<name>": [
{
"source": "<item_slot>",
"Slot": <slot_number>,
"id": "<namespace>:<item_id>",
"Count": <item_count>b,
"tag": {
<item_tag> (if exist)
}
}
]
}
}
What is the source for? It's for displaying the preview
Preview Layout
Click to see the preview layout
armorweaponcontainer(barrel,chest,chest_minecart,shulker_box,trapped_chest) (large_chest, andlarge_trapped_chest,furnace,blast_furnace, andsmoker,dispenser, anddropper,brewing_stand,hopper, andminecart_hopper)enderchesthotbarinventoryhorse(llamas w/ chest,llamas w/o chest,donkey w/ chest, andmule w/ chest,donkey w/o chest,mule w/o chest)
Temp Rule
There is also a new temp rule called createLayoutBeforeDeath. It will create a new layout
(If index 0 exist, then the index is 1, etc.)
death_armor_<index>
death_weapon_<index>
death_inventory_<index>
death_hotbar_<index>
before you die. So you can load them after you pick up all the items to organize back your inventory.
Usage + Video Example
You can create a layout and then load them. For example, you can create the layout before death. And after picking up all the items, you can load the layout to organize back your inventory.
Video Example
(If you see this, I not yet record an updated video, it should be /clayout create entity @p inventory test instead of /clayout create @p inventory test
https://user-images.githubusercontent.com/57800056/137707651-b2010d78-0166-4ae8-bae8-d6580c4f2a85.mp4
Note: If you load a layout, it will take an item from your armor, weapon, inventory and hotbar
So this is similar to the ckit command but it takes the items out of your inventory and rearranges them?
yes, it is gonna useful for survival. So you don't have to layout your inventory back