5

I want to move a boat up/down while a player is in it with commands. I tried to teleport the boat and change the Motion NBT, both worked... while there was no player in it... Somehow, there being a player inside the boats makes it unmovable with these two methods at least.

Edit: Forgot to mention I tried to use another entity below it and teleport it upwards/change its motion upwards to try to push the boat up, which also didn't work.

Edit 2: Just to clarify, I'm trying to move the boat and the player together.

5
  • 1
    Hmm, I would have expected teleporting the boat to work the way you wanted. Your problem is very similar to this one from a while ago.
    – MBraedley
    Feb 1, 2021 at 18:15
  • 1
    Yes, it indeed is very similar, however I'm trying to move the boat (or in their case horse) and not the player on it. I'm guessing it's because both entities are "stuck" to eachother and trying to move either will cause the other to instantly rubberband back. I'm gonna try if teleporting both at the same time works. Feb 1, 2021 at 20:33
  • 1
    If I teleport both they both move, but you get dismounted. Feb 1, 2021 at 20:35
  • 1
    Just so you're clear, you're trying to move the boat without moving the passengers? That isn't really possible with the stock game other than by dismounting the passengers (for instance, by teleporting them).
    – MBraedley
    Feb 2, 2021 at 21:23
  • 1
    @MBraedley, Oh, no I'm trying to move the boat together with the player. I'm trying to make a mech suit. Mar 1, 2021 at 12:27

2 Answers 2

1

I was able to make it work with this command:

/data merge entity @e[type=boat,limit=1] {Pos:[-6d,60d,22d]}

Just place the x y z insted of my numbers.

This worked for me in 1.16.5 for every 2nd or 3rd try. It was quite unconsistent, but it worked sometimes. It seeams to work better when the player has moved a bit with the boat.

In 1.17.1 however, it worked alot better. It worked almost every time, but only if the player had moved a bit in the boat, like 0.2 blocks.


It also didn't work when I tried to move it horisontally, but this was fixed by just moving it 1 block upwards aswell. Still the player need to move a bit for it to work.

You can't use relative coordinates for this, but it works atleast somewhat.

1

I think

/data merge entity @e[type=boat,limit=1] {Pos:[-6d,60d,22d]}

will randomly choose a boat in the world.

So, it should be

/data merge entity @e[type=boat,sort=nearest,limit=1] {Pos:[-6d,60d,22d]}

It will choose the nearest boat to teleport with you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .