Putting Player in Cart

Discussion in 'Plugin Development' started by The_BloodHound, Sep 19, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    The_BloodHound

    I am making a plugin that automatically puts a player in a Minecart when an event is triggered. Help is appreciated! (Don't ask for code. I have no idea. All I have is spawning the Minecart.)
     
  2. Offline

    Ward1246

    You need to have a minecart variable for this to work. If you currently don't have one, you can make one when spawning the minecart, ask me if needed. Anyways, you also need a player variable. Once you have both, it's as simple as minecart.setPassenger(player);

    Let me explain this now. The minecart is the Minecart variable I mentioned before, and the player is the Player variable. Getting the player needs to be something with the event, you must get the player you want to put in the minecart somehow. If you can't get a Player variable, reply to me, I can help you create one somehow. setPassenger(); Is how the player rides the minecart.
     
  3. Offline

    teej107

Thread Status:
Not open for further replies.

Share This Page