#How to write it?

1 messages · Page 1 of 1 (latest)

empty moat
#

I think I know how to make a stack limiting system but I have no idea how to write it.
Can someone help me?

empty moat
#

i want to do it like this (i dont know if it is good but maybe it will work)

#

execute if score @s item_count > max_stack run ---->

#

summon chest_minecart

#

copy item from container to chest minecart

#

set container to stone_block (player eq)

#

set container.2 to stack_size - max_stack (i chest minecart)

#

set container.1 to max_size (i mean count of items)
set current slot stone_block (player)
give to player items from chest minecart container.2 (specific items)
set current slot from container.1 chest_minecart

kill chest_minecart

mossy gull
#

I don't know what you're exactly doing here but it's definitely too complicated

#

What items do you wanna limit the stack of

empty moat
#

anything

mossy gull
#

what do you want the new limit to be

empty moat
#

pitcher plant currently

#

maybe 2 or 6

#

something small

mossy gull
#

well, for every way you can obtain those pitcher plants, through loot tables, through crafting (i honestly dont know how you obtain them i forgot) edit the loot table and change the max_stack_size component to whatever you want

#

and if there is a way that cannot be controlled by loot ables / crafting recipes / similar means, make an advancement that detects whenever a pitcher plant enters your inventory, and modify it's max stack size to 2 or 6

empty moat
#

so i will need to see on youtube how to make loot tables

#

or can i generate them on mcstacker?

mossy gull
#

you will edit vanilla loot tables

#

remind me how do you get a pitcher plant?

#

isnt it a seed u get with sniffers and you plant it

#

i think that's the only way to get it

empty moat
#

i will summon them and players will be able to pick it up

#

that can be any other item

mossy gull
#

is this for a map?

empty moat
#

yes

mossy gull
#

well in this case just.. summon the item with the max_stack_size component right away

empty moat
#

oh ok

#

i searched before how to limit stack_size but somwhere it was written that you can only do it with mods that way

#

and plugins

empty moat
#

no

#

it was on some random website about minecraft

mossy gull
#

well it probably has outdated info

#

what version are you using? if it's 1.20.5+ I think, you could do it easily

empty moat
#

1.20.4 😦

mossy gull
#

hm

#

well that's unfortunate

#

in this case no there is no easy way to do this

empty moat
#

i can just change versions i think

#

to 1.20.5

#

There isn't much difference in syntax

#

or it is?

mossy gull
#

it's like

#

completely different

#

1.20.5 introduced the component system rather than the old item nbt

#

which is more versatile, but it's definitely a change from the last one

empty moat
#

oh, i tought that was introduced in 1.21

mossy gull
#

pretty sure it was 1.20.5

#

In this tutorial we’re taking a look at the new Item Components that were introduced in Minecraft 1.20.5.

I’ll explain what Item Components are exactly, how you can use them in your own items and at the end I show an online tool that makes it really easy to generate your own custom items.

—————————————————...

▶ Play video
empty moat
#

so time to rewrite whole datapack right?

#

is there a lot of changes?

#

or only /give @s netherite_hoe{} had changed to /give @s netherite_hoe[] ?

#

and are there still CustomTags

#

or whatever it is called

#

this thing: /give @s wooden_hoe{CustomTag:20}

mossy gull
#

this is now in a component called custom_data

#

you can read more on the wiki, it's far too much for me or anyone to explain in one form

#

or watch a youtube video, preferbly slicedslime's old 1.20.5 vids

empty moat
#

just tell me if i will need to change lot of things or only this item tags?