#Change stack size globally
1 messages · Page 1 of 1 (latest)
You can modify every stack that appears in a player's inventory or on an item entity
But otherwise no
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
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
What I meant if I pick up 3 apples how do I make them spread out in the inventory instead of turning into one
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
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
I wanna do it for all food so its probably better to do the generalised solution
And doing this for chests can still sometimes result in stacks greater than 1
Would it be to laggy to do on dropped items?
It could become, but if done well you can probably manage it
how can I detect items without custom data with advancements
What
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
Okay
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
You do need to check every inventory slot. You copy it to the item entity with the item replace command
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
I don't understand
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
I mean I guess you could use macros but that sounds kinda dumb
why
Woudnt it future proof it?
Technically
So its overcomplicated or what
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.