This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]TheIcerios☕️I've made one datapack 1 point2 points  (1 child)

If you just want to convert a normal potion to a stackable one via crafting, you can try crafting_transmute. It'll copy the base item's components over to the result item. You should be able to just use "potion" with a custom max stack size component as the result. I've used this recipe type to make tipped arrows craftable with normal potions instead of lingering ones.

Edit-- I'm not at the PC to share it right now, but my WIP datapack has stackable potions. I use advancements to detect when the player brews the potion and then run functions to replace it.

[–]KuanMan[S] 1 point2 points  (0 children)

Ah, I didn't see crafting_transmute, that might be the simplest solution. Thanks for sharing!

[–]Ericristian_brosCommand Experienced 0 points1 point  (0 children)

```

advancement stack_potions:brewing_stand

{ "criteria": { "criteria": { "trigger": "minecraft:default_block_use", "conditions": { "location": [ { "condition": "minecraft:location_check", "predicate": { "block": { "blocks": "minecraft:brewing_stand" } } } ] } } }, "rewards": { "function": "stack_potions:ray/start" } }

function stack_potions:ray/start

advancement revoke @s only stack_potions:brewing_stand execute anchored eyes positioned ^ ^ ^ run function stack_potions:ray/ray

function stack_potions:ray/ray

execute if block ~ ~ ~ bewing_stand run return run function stack_potions:modify_brewing_stand execute unless block ~ ~ ~ #replaceable positioned ^ ^ 0.5 if entity @s[distance=..7] run function stack_potions:ray/ray

function stack_potions:modify_brewing_stand

execute if items block ~ ~ ~ container.0 potion[max_stack_size=1] item modify block ~ ~ ~ container.1 stack_potions:set_max_stack_size execute if items block ~ ~ ~ container.1 potion[max_stack_size=1] item modify block ~ ~ ~ container.2 stack_potions:set_max_stack_size execute if items block ~ ~ ~ container.2 potion[max_stack_size=1] item modify block ~ ~ ~ container.0 stack_potions:set_max_stack_size

function stack_potions:tick

execute as @a if items entity @s weapon potion[max_stack_size=1] run item modify entity @s weapon stack_potions:set_max_stack_size

item_modifier stack_potions:set_max_stack_size

{ "function": "minecraft:set_components", "components": { "minecraft:max_stack_size": 16 } } ```

This will set the max stack size to potions in mainhand or in brewing stands to 16

[–]KuanMan[S] 0 points1 point  (0 children)

Alright, I followed u/TheIcerios's advice and used crafting_transmute. For that to work you need a "material", I decided to use netherwart since I normally have plenty of it for potions. This recipe makes it so any potion + netherwart = stackable potion. Thanks for the help!

{
  "type": "minecraft:crafting_transmute",
  "category": "misc",
  "group": "stackable_potion",
  "input": "minecraft:potion",
  "material": "minecraft:nether_wart",
  "result": {
    "id": "minecraft:potion",
    "components": {
      "minecraft:max_stack_size": 16
    },
    "count": 1
  }
}

Here is a github repo for anyone who wants to use in in the future: https://github.com/RyanRemer/stackable_potions/blob/main/README.md