#Obtain maximum growth stage of a seed
1 messages · Page 1 of 1 (latest)
I only use the getAllStates
oh
i think u can use .value
like get the state then .value it
im not 100% sure though
How?
i just told you
But wouldn't it give me the Current value still?
Get the block, then it’s a component
Yes
then it should work
So set a value for the current component
What the component is called
Wait
Yes
I 'm going
block = tblock.permutation.getAllStates()
console.warn(JSON.stringfy(block))
Is that it
Wait, I need to write it by hand
no u dont
Is it from a block?
Ah no wait
Im on computer
It’s entity
what?
bro..
go in game..
press ctrl + h
then press the "Copy to clipboard" button
{"growth": 7}
Debug all components and print their names
I haven't opened Discord, that's why
How?
Yes
can u send ur whole script so i can do this easier?
thats horrible
And print comp[i]
@gilded sedge
I 'm going
let comps = block.getComponents();
for(let i = 0; i < comps.length; i++) {
console.warn(comps[i]);
}
I'm going to take a while, Discord won't open me because my internet is going wrong
I'll try
theres no need bro
he’s not even using components. he’s using permutations
and this is the list of block components: https://jaylydev.github.io/scriptapi-docs/1.20.0/classes/_minecraft_server_1_3_0_beta.BlockComponent.html
Documentation for Script API - v1.20.0
@granite oar the code
yes i have eyes

The block that the player sees in a distance of 1 block
where is lookingBlock coming from?
Sorry, I've changed it
I Rename it to make it shorter
makes sense
hmm

If not and possible forget it, I think I will have to do it by hand
yeah im not sure
u can use .getState("growth") but
it returns a string
and u cant .value it even if its a number
Anyway thanks
yeah it appears that getState() only returns the current value
might be able to resolve a new permutation with a high growth level and set that (idk how out of bounds would affect it)
It would be the same, how you get the most value
might just have to hard code it depending on the block type
Yes, that's what I'm going to do
u used to be able to get it
yeah u used to be able to get the property
then the .value
like block.premutation.getProperty("growth")
or age
then .value
but minecraft is so stupid and brain dead that they removed it
withState(prop, value)
in the same thread, how can I plant a sapling an pop it as a tree ?
How would that be used?
But with that I can't get the maximum value.
That returns the Current value
So you want to change the value ?
Maybe try an increment ?
For loop with withState method
So how you did ?
Manually
