#Issue with block custom components

1 messages · Page 1 of 1 (latest)

odd orbit
#

My custom components are only working when they are first defined outside of permutations.
This is a concern because I only want my block to tick in specific states, not all.

I'm aware that I can setup a condition to make it only do the stuff I want by checking its state in scripts.
However, it would still tick in the world. if this intended... how performant is randomTick and onTick when a large amount of blocks are placed? (and onTick isn't set to 1 tick)

thorny shadow
#

Script?

odd orbit
thorny shadow
#

And why can you not put the tick in it's own component and include it in the states you want it in?

odd orbit
#

thats what im trying to, separate the ticking

#

but I cannot do that properly because of this issue which is a concern

thorny shadow
#

I do not understand the flow then. I am missing key information. What does the ticking part do?

odd orbit
#

The issue is when I dont define the custom components outside permutations and ONLY use them in permutations, it wont work.

thorny shadow
#

Those messaages there, is the key missing information. I need to look at the example from MS learn, because I can swear they turned on and off a registration.

odd orbit
#

it wont register unless it's defined outside of permutations

pliant meteor
#

This seems like a bug then

odd orbit
#

wonderful.

pliant meteor
thorny shadow
#

This is where I understood that that should work... I came across this and had to study it to see how it worked... It trades off components... https://learn.microsoft.com/en-us/minecraft/creator/documents/customcomponentstutorial?view=minecraft-bedrock-stable#block-custom-components

Maybe you can take their code and it you cannot get it to work, then definitely a bug. If it does work, then the key may be in there

Get started in building with custom components, with this tutorial.

nimble scroll
#

Oh, yeah I've noticed this a few times, if it's not directly being used on a block it doesn't work

#

I don't think it's a bug

#

The workaround is to just have two separate blocks

#

And probably what Mochungus would suggest

#

Considering the flattening

odd orbit
thorny shadow
#

Key .. may be in this paragraph The crop grown component exists on only the finished crop when it is ready to be harvested. This component will allow the player to interact with the block to harvest the strawberries without having to break the block. It then "replants" the strawberries by changing the block permutation back to the first growth stage. This component is registered by making a new class that implements the BlockCustomComponet object, giving you a third way to register components. The same can be done with items and the ItemCustomComponent object.

odd orbit
#

ah...

#

I see.

thorny shadow
#

I see, but then I don't see... its like the chicken and the egg to me right now...

odd orbit
#

I'll just do the third way

#

assuming that'll make it work without Smokey's solution.

#

nvm

#

implements is for typeScript

thorny shadow
#

yes, but convert to js... most is the same

#

just take out the js parts

odd orbit
thorny shadow
#

Lots of vscode extenstions to help with that

#

I use js too, but I can understand code,... just write it in the langauge you are using

night steppe
#

also make sure to import it in the main.js or it wont even register. also needs the full component name name space included ex. 'namespace;custom_component'

stark tide
# odd orbit

We believe this is a content error. The strings don't match.

To fix this, the script (not JSON) needs to change the component name to "vcc:vine_functionality_vino"

odd orbit
odd orbit
#

I even had a friend test it for me, and he didnt have the issue, I guess im insane.

night steppe
#

The custom component names need to match in both files. Script and json

night steppe
#

Try using the debug it should tell you

odd orbit