Delete train wagon with command
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:
30 Replies
Hello @Mowzy! Someone will help you shortly, please do not ping moderators or other people and just wait for someone to come help.
I think theres like
/c trains remove uuid
also pretty interesting idea
yeah
thing is, how would I get that uuid 🤔
maybe /data get entity uuid
Or similar
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)
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
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 ownyeah
cause that's killing the entity
the entity id is different than the train id
:pepethink:
:pepehmm:
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>
it's the TrainId property
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
hm
Train Id looks like this, perhaps if I make it into a string :pepethink:
uh
you need to convert it somehow...
that might be tricky...
you're using kubejs right?
Yup
there's probably something for uuids
Alright some guy helped me out on the KubeJS discord 😄
Still, thank you for the help @Szedann and @Joseph Franci
The KubeJs code looks more like a minecraft enchantment than actual code, but hey... it works 😄
np, what ur making sounds really cool
@Joseph Franci and @Szedann I made a little video to better show off the feature 🙂
https://youtu.be/NQ93Akh_Usc
Mowzy
YouTube
Train Delivery system using Create and Steam'n'Rails + KubeJs
Big thanks to Ucandango from the latvian.dev discord server for helping me out in coding the KubeJs script needed for deleting the train !
This system was made for my French minecraft server, in order to give some new and interesting ways to get money to my players.
Pretty damn cool
Epic, just commented on the vid. Id love to get this into my realistic steam yard map one day
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
You can do /create trains
Then press remove on the train in the menu that comes up
Yeah, but for an automated train removal, /create trains is not gonna cut it
I had to create a custom KubeJs script to make it work
I might make the code available. I'm also planning to make the system work with multiple wagons (with each their own destination)
I already found a way to make a system to identify a train (since you can't use train ID or UUID cause they change every time you assemble / disassemble trains), this will allow me to make sure the wagon you delivered is the right one :coolcolor:
Amazing idea! It makes for a reasonable usage of the coupler block. I’ll try to incorporate this idea for my standards as well