#Delete train wagon with command

48 messages Β· Page 1 of 1 (latest)

analog crown
#

Hello there πŸ‘‹

Anyone knows how I could remove a Create train contraption using a command block ? Or perhaps a KubeJs script ? (or any other method really)
I'm working on a wagon delivery system for my minecraft server and I'm stuck with a wagon

Here are the current steps and my progress :

  1. Wagon spawns in check
  2. Player takes wagon (using an automated SnR coupler) check
  3. Player gets a train station target where he needs to bring the wagon check
  4. Delivers the wagon to the specified location (again, using an automated SnR coupler)* . check
  5. Wagon gets deleted once delivered cross
  6. Player gets reward for completing delivery cross
woven hazelBOT
#

Hello @analog crown! Someone will help you shortly, please do not ping moderators or other people and just wait for someone to come help.

whole gorge
#

I think theres like

#

/c trains remove uuid

rancid creek
#

also pretty interesting idea

whole gorge
#

yeah

analog crown
#

thing is, how would I get that uuid πŸ€”

whole gorge
#

maybe /data get entity uuid

#

Or similar

analog crown
#

the /railways train_uuid command doesn't work on split off contraptions
and /data get entity @e[type=create:carriage_contraption,limit=1,distance=..5] UUID returns this :
(wich is not useable)

rancid creek
#

uh

#

it probably has some different property that stores the train id

#

bit that'd probably also be stored like that

#

cause this is the standard way of storing uuids in mc

analog crown
#

Right, so... I finally got the uuid of the train using a KubeJs script, now the problem is that the command /create killTrain 17b4659c-c9ae-4659-8e2c-35d998c6c205 won't work....

Using /kill 17b4659c-c9ae-4659-8e2c-35d998c6c205 will make the train contraption disappear for 1 tick (so I know the uuid is good) but the contraption will just re-appear on its own

rancid creek
#

yeah

#

cause that's killing the entity

#

the entity id is different than the train id

analog crown
#

how the flippity floppity hello kitty am I supposed to get that special Id... SnR has a command /railways train_uuid <name> but I can't use it on a split off contraption since it's name is Split off from:<train name>

rancid creek
#

it's the TrainId property

analog crown
#

Bruh....

#

Extracted the TrainId, used it to try and remove the train

#

check out the error output.....

#

[14:21:00] [Server thread/INFO]: Invalid UUID

rancid creek
#

hm

analog crown
#

Train Id looks like this, perhaps if I make it into a string pepethink

rancid creek
#

uh

#

you need to convert it somehow...

analog crown
#

that might be tricky...

rancid creek
#

you're using kubejs right?

analog crown
#

Yup

rancid creek
#

there's probably something for uuids

analog crown
#

Alright some guy helped me out on the KubeJS discord πŸ˜„
Still, thank you for the help @rancid creek and @whole gorge

#

The KubeJs code looks more like a minecraft enchantment than actual code, but hey... it works πŸ˜„

whole gorge
#

np, what ur making sounds really cool

analog crown
whole gorge
#

Pretty damn cool

crisp flame
#

Just imagine having to take a train from the shed on the turntable, drive through the yard onto a set of wagons whilst also looking at signals

#

Oef

warm arrow
#

Then press remove on the train in the menu that comes up

analog crown
analog crown