#Change stack size globally

1 messages · Page 1 of 1 (latest)

tulip gulch
#

Is it possible to change stack size of a item without modifying every loot table with it

sick sail
#

You can modify every stack that appears in a player's inventory or on an item entity

#

But otherwise no

tulip gulch
#

So I want to make the stack size 1
Can I make an item tag
And spread the items in the tag in the inventory so I don't have to make advancement for every item

sick sail
#

Not sure what you mean by the last time, but yes you should make an item tag to handle all the times you want to change the stack size of

tulip gulch
#

What I meant if I pick up 3 apples how do I make them spread out in the inventory instead of turning into one

sick sail
#

If the stack is greater than 1, summon a new item entity, copy the stack's data to it but with a count of 1, and decrement the original stack's count

wise tendon
#

Or modify the loot table of leaves and some chests to have the max stacksize already set. For apples that isn't a super large amount of loot tables

tulip gulch
#

I wanna do it for all food so its probably better to do the generalised solution

sick sail
tulip gulch
#

Would it be to laggy to do on dropped items?

sick sail
#

It could become, but if done well you can probably manage it

tulip gulch
#

how can I detect items without custom data with advancements

sick sail
#

What

tulip gulch
#

So I want to make an advancement that detects if an item has a food component
and it doesn't have custom data like {item_changed:true}

#

but now that I think about it I'm just gonna remove food component entirely

sick sail
#

Okay

tulip gulch
#

I'm not quite sure how to edit the picked up item
I have advancement that triggers when food is picked up but I dont know how to target the item without checking every inventory slot

#

and how to copy its data to /give or something

sick sail
#

You do need to check every inventory slot. You copy it to the item entity with the item replace command

tulip gulch
#

can I procedurally copy nutrition value to regeneration length in ticks in consumable tag

#

so I dont have to make it one by one

#

so bread would give you 2.5 hearts

sick sail
#

I don't understand

tulip gulch
#

bread restores 5 nutrition
so when you pick it up I want it to looses the nutrition value and get 5 ticks of maxed out nutrition so it would regenerate 2.5 hearts

#

I know how to get this food with commands

#

but I want to generalise that so I dont have to make adnvancement for every food

sick sail
#

I mean I guess you could use macros but that sounds kinda dumb

tulip gulch
#

why

tulip gulch
#

Woudnt it future proof it?

sick sail
#

Technically

tulip gulch
#

So its overcomplicated or what

wise tendon
#

You can also use (beet/bolt) templates.

#

Macros aren't the best for performance, hardcoding most foods would in some cases still be preferable.

You probably could also just work with a fake player score that an item modifier can reference.

#

The latter is almost the same as a macro, but a lot cheaper for performance.