#i was trying to make slimes spawn bigger, but when killed they still spawning big,

1 messages · Page 1 of 1 (latest)

oak plank
#

which means that the slimes are imposible to kill

barren loomBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

valid summit
#

You are using a tick function to change all slimes size, right?

valid summit
#

Do you want variety with spawned slime sizes?

oak plank
#

like size 15-24

#

version (1.20.1)

valid summit
#

Well i dont know if slimes carry over all nbt data after splitting or just the custom name

#

But if they do, you can just check for slime sizes 0-2 and change it to your desired ones and tag that slime so it wont be selected again

oak plank
#

@valid summit there is a way to just modify the size once?

soft tide
#

yes, when you change the size, also add a tag to the slime, and only change the size of slimes that don't already have that tag

oak plank
#

but how do i add that tag to the slimes that got killed?

soft tide
#

i'm fairly certain tags are carried over when the slime splits (as kq already mentioned) so that takes care of itself

oak plank
#

like this ?

#

execute as @e[type=ghast,tag=!modified] run data merge entity @s {Size:20}
tag @e[type=ghast] add modified

soft tide
#

generally it'll be better to do something like execute as @e[tag=!modified] run function ns:modify where ns:modify looks like:

tag @s add modified```
#

but that's the basic idea, yes. though i assume you didnt mean to have ghasts as your target there now

oak plank
#

okay i will try t

#

tick.mcfunction

#

slime.mcfunction

#

i did this

soft tide
#

looks good. does it work?

oak plank
#

i will try

#

give me a minute

#

well, it works because the slimes are spawning in size 20, but when killed, they split into 2 slimes with the same size, and they are supposed get smaller after killed

valid summit
#

ouch. that means slimes dont carry nbt sadly

oak plank
barren loomBOT
# barren loom <@&1201956957406109788>

<@&1166082198152159386> <@&1202694677766348840>

🙇 Helpers Arise!

Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)

shrewd radish
shrewd radish
#

@oak plank the provided solution to tag the slimes should work.

Tick function should look like:
execute as @e[type=slime,tag=!ns.modified] run ns:function

where this function would perform the following:
data modify entity @s Size set value <your_number>
followed by:
tag @s add ns.modified

Slimes that are killed should retain the tags of their "parent" I used ns.modified here to avoid conflicts with other datapacks you can also pick a more simple name.

shrewd radish
#

in short, if a slime does not have your tag, grow it and grant it the tag.

shrewd radish
#

a size 15 slime will split into size 7 which will split into size 3 (vanilla large slime)

#

if you don't want to change the way the slime splits, just its size, you would need attributes

oak plank
#

what attributes i need

shrewd radish
#

do you actually want this?

#

normal slimes go:
3 to 1 to 0
15 to 7 to 3 to 1 to 0 is what you get if you change the Size of a slime

#

do you want to grow all slimes or only bigger slimes?

shrewd radish
#

you want them to split 5 times? then you dont need attributes

oak plank
#

i want 15-7-3-1

shrewd radish
#

small slime = 0

oak plank
#

but all of them spawning with size 15

shrewd radish
#

1 is medium

oak plank
#

but when killed i want them to split into smaller slimes

#

but when i kill them, they split into 2 slimes with size 15

#

even after did what you said

shrewd radish
#

that is highly unlikely, have you checked the output for any issues and done a reload after making the changes?

#

also, which version are you on? please share your functions in full if you can

oak plank
#

my version is (1.20.1)

#

tick.mcfunction

shrewd radish
#

alright my hunch is that this is not documented properly on the minecraft wiki. The correct behavior for the slimes retaining tags was added somewhere in 1.21 but the wiki does not list the exact java version (it does list a bedrock 1.21 version)

oak plank
#

damm

shrewd radish
#

i was testing in 1.21.5

oak plank
#

well, there is a way to make what i want in 1.20.1?

shrewd radish
#

without being able to use the tags it is definitely harder to do

#

as I can imagine you dont want it to matter who or what killed the slime

#

in which case a tag would've been very convenient

oak plank
#

so we are not able to add a tag to the slime?

shrewd radish
#

you can but if it is not retained it wont matter

oak plank
#

and there is not a way ton retain the tag?

#

to*

shrewd radish
#

if the game doesn't do it for you, no there is not

#

you can't distinguish naturally spawned and spawned from killed slimes

oak plank
#

so is not posible in 1.20.1

#

?

shrewd radish
#

Depends, it could be that some other things are retained, a custom_name from a nametag for instance.

#

I am booting up 1.20.1 to see what I can find

oak plank
#

okay

#

ty

#

tell me what you find

shrewd radish
#

I will first try the method with the tags, just in case it does work and I missed something.

oak plank
#

okay

shrewd radish
#

nope, won't work

#

you can't tell the difference

oak plank
#

did you try with the custom name?

shrewd radish
#

ah, i forgot to test that

#

You can use CustomName

oak plank
shrewd radish
#

it is probably not that good for performance

#

it also allows cheating it by renaming a small slime

#

which would then grow to size 15 again 😄

oak plank
#

but it´s okay

#

it is better than nothing

#

but how do i add the custom name to make that?

#

well i know how

#

but just adding it next to data modify entity @s Size set value 15?

shrewd radish
#

example:

data modify entity @s CustomName set value '{"text":"Slime"}'

Filtering would be:
execute as @e[type=minecraft:slime,name=!Slime] ...

#

in this case the name of the slimes is Slime

#

You can make the name look a lot fancier using text component tools but I am not sure how the selector would resolve it

#

wait.... im having some trouble lol

#

the execute as is doing some weird stuff

#

you can do name=! without a name behind it to select a nameless slime

#

this way renaming won't do anything either

#

nevermind

oak plank
#

what happened?

shrewd radish
#

above selector is fine, I am not sure what I just did lol

shrewd radish
#

so you do !<your_name>

#

colors are ignored

#

so you can do fancy colors in the slime name

#

make it green or rainbow colored

oak plank
#

lool

#

look*

#

this is the slime function

#

and this is tick.mcfunction

#

it is fine?

shrewd radish
#

remove the tag, you wont need it unless you update your pack to 1.21 and can use the tag

#

yes this should work

shrewd radish
#

you can make the name green like:
data modify entity @s CustomName set value '{"text":"Slime","color":"green"}'

#

this does not change or break the other stuff

oak plank
#

is not working, the slimes are spawning in normal size

#

without the custom name

shrewd radish
#

hmmm

oak plank
shrewd radish
#

I see, it is not updating the custom name

#

strange

#

I have the same issue now, but I can't tell why exactly

#

It could be that the function run as the slime can't modify the name of the slime

shrewd radish
#

I don't know

#

I would honestly suggest updating to 1.21, makes life easier.

Perhaps some other datapacker knows how to do this (it worked for me with single entities and commands on single entities)