Skip to content

Minecraft 1.19 Datapack aiming at limiting the stack size of players inventory to 1 item per slot

License

Notifications You must be signed in to change notification settings

Juloos/MCDatapack.UnstackableSlots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

MCDatapack.UnstackableSlots

Minecraft 1.19 Datapack aiming at limiting the stack size of players inventory to 1 item per slot

Installation

See this tutorial for installing the datapack to your minecraft world.

Ingame functions

Use

/function unstackable_slots:config/enable

And

/function unstackable_slots:config/disable

To respectively enable or disable the datapack, one will need to put every modified item on the ground after disabling the datapack for them to be reset.

Technical details

Every tick, the datapack modifies all item entities with NBT Item:{Count:1b}, those items are given an id in the tag Item:{USSid}, and this id a unique integer that ranges from $-2^{31}$ to $2^{31}$ and keeps adding 1 to itself each time it is requested.

When a player inventory changes (detected using the minecraft:inventory_changed advancement trigger) all its slots are checked, and if the number of item in a given slot is 2 or more, then it is set back to 1 and a recursive function is called to give to the player the same amount of item, where each of them is modified to have their unique id.

About

Minecraft 1.19 Datapack aiming at limiting the stack size of players inventory to 1 item per slot

Resources

License

Stars

Watchers

Forks

Packages

No packages published