Minecraft Data Packs / Game Mechanic

Potion Stacker [1.14+] BETA 1.1

  • check_circle Functions
  • check_circle Loot Tables
  • 6,713 views, 2 today
  • 364 downloads, 0 today
  • 14
  • 14
  • 13
Eglaios's Avatar Eglaios
Level 46 : Master Miner
16
Have you ever wanted to stack these bulky potions occupying most of your slots?
I guess this is just the right place for that :

This datapack will allow you to stack same potions together, as simple as that!



The pack is now on Beta 1.1! Every regular potions (but water bottles) are now supported!


Mechanics :

Merging potions
In order to merge two potions together, you will have to drop them close to each other (droppers works too), then both potions will stack together as one.
The resulting potion will have its stack size displayed between brackets (see screenshot) after its name.

Take note that only same type potions can be merged. For example, a 3:00 fire resistance potion is compatible with another 3:00 one, but will not stack with a 8:00 one.
However, data-modified potions can stack as well; the only merging criteria is the potion type, no matter of custom effects or other tags.

Merging already-stacked potions together is also possible.
However, the maximum stack size is 2.147.483.639; the potion item will get a negative stack value and become broken if exceeding this limit.

Drinking stacked potions
If a 2-or-more stacked potion is drunk, the held potion's stack size will decrease by 1, and the player will get back a glass bottle (see video).
If a player drinks a 2-stacked potion though, it will then turn into a regular potion, which will become empty after drinking.

Both right and left hand are supported by the system.

Specs
  • As the pack use Minecraft translation files to render potion names, every single minecraft language is supported (Reload message will not be translated though).

  • In order to give back a custom-named potion, a modified shulker box loot table is used : If any of these are broken using barrier item, it drops its content instead of itself. Otherwise, it will always drop normally.

  • [​FIXED] Beta 1.1, giving back the held item
    In order to detect stacked potion drinking, the system tests if the player have drunk at the same time it had a glass bottle in right/left hand, and if the glass bottle was a supported potion during previous tick.
    As a result, switching hands at the exact same tick the player drinks a stacked potion will cause the system to get the wrong slot data, then will make the wrong changes, and potions could be lost by that.
    Hopefully, I know how to fix that, this glitch will disappear the next release, in a couple day.

  • Stacked potions does not support brewing stands : if brewed, a stacked potion will turn into a single, regular one, which will clear the stack.


Special thanks to Cloud Wolf, who describe how to add dynamic item data using shulker box trick in its video :
www.youtube.com/watch?v=2z1uEhFVzFA



Any feedback is welcome to improve this pack while there is only few supported potions!

Thank you!


CompatibilityMinecraft 1.14
toMinecraft 1.16
Tags

1 Update Logs

Update #1 : Beta 1.1 : by Eglaios 05/27/2020 3:50:10 pmMay 27th, 2020

-Every single 38 regular potions are added into the pack

-When the player drinks, the pack checks if the slot does not contain a valid potion in order to give modified potion back. Before, it checked if there was a glass bottle (planning to do same for throwable potions)

-The commands to assign held potion IDs are now in eglaios_pstacker:detection/held_potion and are only triggered if one holds a potion. Before, they were all in eglaios_pstacker:main (there were only 2 potions supported)

-Added potion library for merging potions in eglaios_pstacker:merge_potions. Planning to add lingering an splash library here as well

Create an account or sign in to comment.

1
06/10/2020 7:30 pm
Level 1 : New Miner
TheDarkWarrior
TheDarkWarrior's Avatar
Hey this looks great, but i was thinking if you could make another one too that instead of making this, that makes the stack limit change, for example have 5 potions in the hand, like the /replaceitem in vanilla, but instead a datapack that allows you to have them together, like the plugins that pvp server use, but a datapack? Thanks!!!
1
06/03/2020 3:24 am
Level 14 : Journeyman Architect
Aza_Gorod
Aza_Gorod's Avatar
Very nice this makes potions worth it xD no more trying to use a shulker box to keep some. Now I can have all of them together!



I wonder if there might be away to do this with totems, that would be very nice!
1
06/05/2020 12:03 pm
Level 46 : Master Miner
Eglaios
Eglaios's Avatar
Totems? I could not make dragon breath overstackable, but ye, I think I could make totems stack as well!

I actually took a pause because of some hardware problems. I have still some gun systems to make for a forum user, so I might go back on the pack update in one or two days...
1
06/01/2020 6:40 am
Level 1 : New Miner
le_geek
le_geek's Avatar
Wait... WHAT !!!?
et pourquoi je m’embète à parler en anglais alors que tu parles français? Jsp mais le truc que je me demande c’est comment tu peut te vanter d’avoir fait Le meilleur truc du monde ?nn j’rigole mdr 😝
and for everybody who understands nothing i said :

USE GOOGLE TRADUCTION OR WORDREFERENCE pls 🙏
1
05/28/2020 10:20 pm
Level 49 : Master Crafter
NTDan
NTDan's Avatar
(mind blown)

Seriously though, this is really amazing... since I actually don't know how it works.
1
05/29/2020 6:53 pm
Level 46 : Master Miner
Eglaios
Eglaios's Avatar
The greatest trick was to detect what potion the player drank and in what hand, although the potion disappears once you drink it.

As quick as that, the pack keeps in memory what potion the player had last tick in each hand.
When you drink a leaping potion in left hand, the pack sees that you were holding it on left last tick, and as you lost it on the same tick you drank, it knows you drank it, and give it back.

When the potion is given back, it clears the item in hand; switching your potion with a sword at the same tick you drank it was deleting the sword.
However, beta 1.1 now stores the replaced item, and give it back once the potion delete it.

Of course, it can not copy the potion's data as it's gone; stack size and potion id are both stored as player score

There's a system using shulker box loot table and json signs behind to give back modified items in the right slot


Uh I didn't say it but it's perfectly working in multiplayer
1
05/29/2020 9:50 pm
Level 49 : Master Crafter
NTDan
NTDan's Avatar
(by the way this may sound disappointing, but you could've just changed the stack size lol)
drinking 1 potion from a stack of 64 does exactly what you want it to without all the commands
1
06/01/2020 2:28 pm
Level 46 : Master Miner
Eglaios
Eglaios's Avatar
Well the fun part comes when you get thousands of potions in your hand... I wanted to be able to take all potions together (still a limit of 2B though)
1
06/01/2020 11:32 pm
Level 49 : Master Crafter
NTDan
NTDan's Avatar
I feel like no one’s gonna go out of their way to get 700 MILLION material stuff lol
1
05/28/2020 8:22 am
Level 20 : Expert Bear
Bermsy
Bermsy's Avatar
will this work with dragons breath? I have tons of dragons breath and i don't want to have a million chests for all of them?
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome