#kubejs private variables

38 messages · Page 1 of 1 (latest)

onyx glen
#

Hello everyone Tell me, is it possible to make different logic for the same mechanisms? For example, I have 2 cars with a progress variable and this variable turns out to be the same for 2 mechanisms.

vestal wraithBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

plucky wyvern
#

cars, mechanisms, and progress variables...
not gonna lie im completely lost

worn hinge
#

he means that there are 2 identical mechanisms working on the same recipe and for each of these recipes you need to make separate variables, but how to do this if kubejs does not seem to support the class?

worn hinge
plucky wyvern
#

is there any context to this to go off of?

#

this is extremely vague

grand laurel
#

??helpyou

chrome cliffBOT
# grand laurel ??helpyou

╰( ͡° ͜ʖ ͡° )つ──☆:・゚˜”°•.˜”°• Many Help •°”˜.•°”˜*
Please provide a description of your issue with as much detail as possible. If you have an issue with a script provide the script. Explain what you can see happening and what you expect to happen. Be specific!

Tell us what is happening, we already know it "doesn't work".
Avoid using words like "it", tell us exactly what "it" is.
Don't assume anyone knows what you are talking about, be specific.

Provide screenshots or video if possible.
Provide the log.

worn hinge
# plucky wyvern is there any context to this to go off of?

the recipe is to find the coordinates of the block every tick and delete it, and on the next tick to take the next block, but for this you need to remember the coordinates of the previous block, this requires 3 variables that will be separate for each recipe because if they are confused, they will not be deleted those blocks

viral wadi
#

I think..... this is an nbt question?

plucky wyvern
#

recipe that finds blocks, wth

viral wadi
#

nevermind

#

this is custom machinery all over again lol

#

where's squishy

plucky wyvern
#

oh fuck me

worn hinge
worn hinge
plucky wyvern
#

that wouldve been a great sentence to start with

#

xD

#

cuz "mechanism" makes no sense in this context lol

worn hinge
#

and yet I need to save the coordinates somewhere so that I can get them in the next tick. a class would be suitable for this, each mechanism would be an object with its own variables, but if kubejs does not support classes, you need to put them somewhere, and then get the coordinates

worn hinge
viral wadi
#

what if you made like a map that was based on remaining time in the recipe?

#

so on this tick delete this block, on that tick delete that one

plucky wyvern
#

cant you save it to the tile entity?

worn hinge
worn hinge
worn hinge
plucky wyvern
#

have to go to bed now tho

viral wadi
#

but based on the earlier code, your recipe is only like 1 tick long....

#

you can schedule stuff in the future....

worn hinge
viral wadi
#

so like

Utils.server.scheduleInTicks(someTickCount, someData, callback => {
  let data = callback.data
  // do something with data
})
worn hinge
worn hinge
viral wadi
#

what you passed as someData