1.12.2 How do I save a minecart to a variable?

Discussion in 'Spigot Plugin Development' started by Sanfeanso, Aug 7, 2020.

Thread Status:
Not open for further replies.
  1. Basically the title, I'm currently trying to make a roller coaster plugin, and when you do a command it will spawn 8 Minecarts, then with another method it will move the minecarts using the setVelocity() method.
  2. You want these minecarts to be saved as a variable?
    Just cast Minecart to World#spawn.
  3. Learn Java and use Google!
    1. Cate a variable
    2. Spawn a entity
    3. Cast the Entity
    (the order is what you prefer)
    Code (Text):
    Minecart cart = (Minecart) world.spawnEntity(loc, EntityType.MINECART);
  4. Thanks for the help, but seriously saying learn java and use google won’t help. I already spent a few hours searching google for an answer to my question. Yet found nothing.
    • Agree Agree x 1
  5. I don't know if this can help you but Spigot has a wiki where you can learn how to create plugins. (y)


    Take a look to the part "Guide"
Thread Status:
Not open for further replies.