#Obtain maximum growth stage of a seed

1 messages · Page 1 of 1 (latest)

granite oar
#

send the code

gilded sedge
granite oar
#

oh

#

i think u can use .value

#

like get the state then .value it

#

im not 100% sure though

gilded sedge
#

How?

granite oar
#

i just told you

gilded sedge
#

But wouldn't it give me the Current value still?

granite oar
#

just

#

try

#

does it return a number?

lucid dune
#

Get the block, then it’s a component

gilded sedge
granite oar
#

then it should work

lucid dune
#

So set a value for the current component

gilded sedge
granite oar
#

bro

#

can u get the current growth stage?

lucid dune
#

Wait

granite oar
#

@gilded sedge

#

??

#

send ur code

#

rn

gilded sedge
#

I 'm going

#

block = tblock.permutation.getAllStates()

console.warn(JSON.stringfy(block))

#

Is that it

granite oar
#

ok then what does JSON.stringify block return?

#

send the string it returns

gilded sedge
granite oar
#

no u dont

lucid dune
granite oar
#

if ur console.warning it

#

u can copy the console to clipboard

gilded sedge
granite oar
#

no

#

they dont know what they are doing

lucid dune
#

Ah no wait

gilded sedge
lucid dune
#

It’s entity

granite oar
#

what?

granite oar
#

go in game..

#

press ctrl + h

#

then press the "Copy to clipboard" button

gilded sedge
#

{"growth": 7}

lucid dune
#

Debug all components and print their names

gilded sedge
granite oar
#

try to

#

one sec

gilded sedge
gilded sedge
granite oar
#

can u send ur whole script so i can do this easier?

lucid dune
#

block.getComponents()

#

Then for loop

granite oar
#

thats horrible

lucid dune
#

And print comp[i]

granite oar
gilded sedge
#

I 'm going

lucid dune
#

let comps = block.getComponents();
for(let i = 0; i < comps.length; i++) {
console.warn(comps[i]);
}

gilded sedge
lucid dune
#

Idk the comp id so check them out

#

Them*

granite oar
#

are u using this on crops?

#

@gilded sedge

gilded sedge
#

.

#

Yes

velvet drum
gilded sedge
granite oar
#

yes i have eyes

gilded sedge
granite oar
#

what is looking block supposed to be?

#

tblock?/

gilded sedge
#

The block that the player sees in a distance of 1 block

velvet drum
gilded sedge
#

Sorry, I've changed it

velvet drum
#

oh

#

lol

gilded sedge
#

I Rename it to make it shorter

velvet drum
#

makes sense

granite oar
#

hmm

gilded sedge
gilded sedge
granite oar
#

yeah im not sure

#

u can use .getState("growth") but

#

it returns a string

#

and u cant .value it even if its a number

gilded sedge
#

Anyway thanks

velvet drum
#

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)

gilded sedge
#

It would be the same, how you get the most value

velvet drum
#

might just have to hard code it depending on the block type

gilded sedge
#

Yes, that's what I'm going to do

granite oar
#

u used to be able to get it

gilded sedge
#

Well, thanks, I'm going to close this post

granite oar
#

then the .value

#

like block.premutation.getProperty("growth")

#

or age

#

then .value

#

but minecraft is so stupid and brain dead that they removed it

lucid dune
#

withState(prop, value)

#

in the same thread, how can I plant a sapling an pop it as a tree ?

gilded sedge
lucid dune
#

permutation.withState("age_bit", true);

#

Or number or string

gilded sedge
lucid dune
#

Ah

#

permutation.getState(stateName);

gilded sedge
#

That returns the Current value

lucid dune
#

So you want to change the value ?

#

Maybe try an increment ?

#

For loop with withState method

gilded sedge
#

I don't think it works

#

But I think I solved it, even so thanks

lucid dune
#

So how you did ?

gilded sedge
#

Manually