Skip to content
Nuparu00 edited this page Apr 4, 2024 · 5 revisions

The goal of this wiki is to explain how to configure the TinyInv mod. This wiki was made for the 1.20.1-1.1.0.1 version of the mod.

How it works?

The baseline settings for the mod are defined in the server config file - tinyinv-server.toml. This file is a save specific, located inside the serverconfig subfolder of the given save.

The values specified in there serve as the default values, that every newly spawned player has. However, every player also has their own ost of attributes, that by default have "neutral" values - they don't affect the result state. The values of these attributes can be modified directly or indirectly using attribute modifiers. This can be done using commands, editors, or other mods.

Lastly, the client has some control over how the mod affects rendering. This includes things like how the "removed" slots are hidden or the maximal number of slots in a hotbar row. These settings can be altered inside the client config file - tinyinv-client.toml, which is located inside the config subfolder of your Minecraft directory.

Server Config

By default the server config looks like this:

[general]
	#The default number of slots
	#Range: 0 ~ 36
	inventory_slots = 36
	#The default number of hotbar slots
	#Range: 0 ~ 36
	hotbar_slots = 9
	#Should offhand slot be enabled?
	offhand_slot = true
	#Should offhand slot be enabled?
	head_slot = true
	#Should offhand slot be enabled?
	chest_slot = true
	#Should offhand slot be enabled?
	legs_slot = true
	#Should offhand slot be enabled?
	feet_slot = true
	#Should offhand slot be enabled?
	crafting_top_left_slot = true
	#Should offhand slot be enabled?
	crafting_top_right_slot = true
	#Should offhand slot be enabled?
	crafting_bottom_left_slot = true
	#Should offhand slot be enabled?
	crafting_bottom_right_slot = true
	#Should exclude the players who are in creative mode?
	exclude_creative_mode_players = true
	#What indexing to use? Mojang counts inventory slots from top to bottom, while TinyInv counts from bottom to top (which lines up better with hotbar indexes)
	#Allowed Values: MOJANG, TINYINV
	indexing = "TINYINV"

These default settings were chosen as they practically do not alter how the game works - it looks the same even though the mod is loaded. Most of these should be self-explanatory, with the possible exception of the last two.

  • exclude_creative_mode_players - Determines whether players who are in creative mode should be affected by the mod. If this is true, the creative mode feels the same as in Vanilla Minecraft. Spectator mode players are never affected by the mod, no matter what the value of this option is.
  • indexing - The way Vanilla Minecraft indexes inventory slots is rather counter-intuitive. The hotbar slots are indexed 0-8 from left to right. However, the indexes however the row above has indexes 27-35, not 9-17. TinyInv, by default, converts the Vanilla Indexing into more intuitive ones.
Vanilla Indexing TinyInvIndexing
Vanilla Indexing TinyInv Indexing

So the value of indexing affects what slots become first a part of the hotbar, and what slots disappear first, when you decrease the number of inventory slots.

Client Config

By default, the client config looks like this:

[general]
	#Should draw overlay over the disabled slots
	disabled_slot_overlay = true
	#Color of the disabled slot overlay
	#Range: > 0
	disabled_slot_overlay_color = 13027014
	#Should hide the offhand slot? Ignored if disableOffhand in the common config is true
	hide_offhand = false
	#The maximal number of slots in a hotbar slot (0 = as many as fit the screen)
	#Range: > 0
	max_slots_in_hotbar_row = 9
	#Order of hotbar rows?
	#Allowed Values: NORMAL, REVERSE
	order = "NORMAL"
	#Alignment of the hotbar rows?
	#Allowed Values: CENTER, LEFT, RIGHT
	alignment = "CENTER"
	#Should move and resize the chat so it is not obstructing the hotbar rows?
	transform_chat = true
  • disabled_slot_overlay - TinyInv does not actually remove the slot from GUI texture, it just draws a square overlay over the area that is physically taken by the slot. Because this color matches the color of the GUI background, it looks like the slot was removed. However, with this option, you can disable this, so removed slots will still appear (however you won't be able to interact with them as they are just images).
  • disabled_slot_overlay_color - Color of the overlay. Useful when you use a resource pack that changes the background color of the container GUI. The value is color RGB as base-10 integer. So the default background color #c6c6c6 R:198 G:198 B:198 whose hexadecimal representation is #c6c6c6 is 13027014 in base-10.
  • hide_offhand - Allows you to hide the offhand slot next to the hotbar when holding an item offhand. The offhand slot is still usable and the held items work the same - it is just that the slot is not rendered.
  • max_slots_in_hotbar_row - How many slots can be in a single hotbar row. If the number of hotbar slots is larger, a new row is created. If the value is 0, all slots are put into a single row.
max_slots_in_hotbar_row = 9 max_slots_in_hotbar_row = 18
max_slots_in_hotbar_row = 9 max_slots_in_hotbar_row = 18
  • order - Controls whether new hotbar rows should be added above or below the previous one.
order = NORMAL order = REVERSE
order = NORMAL order = REVERSE
  • alignment - Controls how should a partially filled row be aligned, relative to the longest row.
alignment = LEFT alignment = CENTER alignment = RIGHT
alignment = LEFT alignment = CENTER alignment = RIGHT
  • transform_chat - Controls whether the chat box should be moved so it does not obstruct the UI.
transform_chat = true order = false
transform_chat = true transform_chat = false

Attributes

While modifying the inventory globally from the server config, just like it was in the previous version of TinyInv, might be enough for some, it is possible to alter the inventories of individual players - thanks to Attributes.

There is a new player-only Attribute for (almost) each of the server config options.

Server Config Option Attribute ID
inventory_slots tinyinv:slots
hotbar_slots tinyinv:hotbar_slots
offhand_slot tinyinv:offhand_slot
head_slot tinyinv:head_slot
chest_slot tinyinv:chest_slot
legs_slot tinyinv:legs_slot
feet_slot tinyinv:feet_slot
crafting_top_left_slot tinyinv:crafting_top_left_slot
crafting_top_right_slot tinyinv:crafting_top_right_slot
crafting_bottom_left_slot tinyinv:crafting_bottom_left_slot
crafting_bottom_right_slot tinyinv:crafting_bottom_right_slot

These can be altered both directly and indirectly (by Attribute Modifiers) using commands, other mods, or using the datapack system provided by TinyInv.

Datapacks

While TinyInv is meant as a mod, that is configured by a content creator, to fit their needs (modpack, server, minigame, map), TinyInv offers a way to easily configure (and share configurations) the mod as a standalone experience. This is done by extending the Vanilla datapack system. This allows you to add Attribute Modifiers to items and effects, without the need for commands or 3rd party mods.

The system allows you to add an Attribute Modifier for any Attribute to any Item or status effect (though it really is meant just for modifying the Attributes added by TinyInv).

Users

If you wish to use a datapack for the mod, you can install it as any other datapack, by putting the downloaded .zip file into the datapacks subfolder of your save. You can find a more detailed guide on the Minecraft Wiki.

Creators

This guide assumes you have already set up your datapack. In the data/namespace/ folder create a new folder called default_attributes. Inside this folder you can create the individual .json files that control the modifiers. The names of the files have no effect on the game.

Let's add a modifier for Golden Chestplate, that makes it so wearing the chestplate grants the player 4 additional inventory slots and removes 1 hotbar slot. Create a file golden_chestplate_4i-1h.json. First, specify it is a modifier applied by an item.

{
   "type":"item"
}

Next, let's specify the item by adding

"item":"minecraft:golden_chestplate" 

Now we have to list the modifiers. This is done by adding an array of objects called attributes

"attributes":[

]

Each object in this array represents a modifier. Modifiers for items are defined by the Attribute they modify, the slot they have to be in, the value of the modifier, and the operation.

  • The accepted values of slot are mainhand, offhand, head, chest, feet and legs
  • The accepted values of operation are ADDITION, MULTIPLY_BASE and MULTIPLY_TOTAL

The modifier objects we add are:

{
   "attribute":"tinyinv:slots",
   "amount":4,
   "slot":"chest",
   "operation":"ADDITION"
}

and

{
   "attribute":"tinyinv:hotbar_slots",
   "amount":-1,
   "slot":"chest",
   "operation":"ADDITION"
}

The result .json file contains

{
   "type":"item",
   "item":"minecraft:golden_chestplate",
   "attributes":[
      {
         "attribute":"tinyinv:slots",
         "amount":4,
         "slot":"chest",
         "operation":"ADDITION"
      },
      {
         "attribute":"tinyinv:hotbar_slots",
         "amount":-1,
         "slot":"chest",
         "operation":"ADDITION"
      }
   ]
}

Adding a modifier for an effect works almost the same way, except the fact, that item is replaced by effect and the slot property is omitted.

{
   "type":"effect",
   "effect":"minecraft:weakness",
   "attributes":[
      {
         "attribute":"tinyinv:slots",
         "amount":-4,
         "operation":"ADDITION"
      }
   ]
}

Could be of a note, that if you omit the type property, the mod defaults it to item. If you omit the operation property, the mod defaults it to ADDITION.

You can download an example datapack from CurseForge.

Implementation Details

If there are multiple modifiers (even across multiple files) for the same item/effect and attribute (and in case of items also slot) with the same operation, they are joined into a single modifier. In LAN/Multiplayer, the item modifiers are synced to the clients, so they can correctly display them in the item tooltip. However, effect modifiers are not synced.

The removed slots (with the exception of the crafting slots) are filled with an unobtainable and invisible item tinyinv:fake_item. This is done to prevent these slots from accepting dropped items. The actual slots inside the Container are replaced by a FakeSlot, which can not be interacted with.

Clone this wiki locally