Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2643

cart.setPassenger() leaves player positioned off to one side

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None

      I'm seeing problems with setting players as a passenger in a minecart.

      I've spawned a minecart at the desired rail block's location, then set the player to be a passenger in that cart, with code like:

      // OK, place a minecart on the clicked rail
      Minecart cart = e.getClickedBlock().getLocation().getWorld().spawn(
      e.getClickedBlock().getLocation(),
      Minecart.class
      );
      // then put the player into it
      cart.setPassenger(player);

      It works, insofar as a minecart is spawned, and the player does ride it - however, the player is positioned off to one side of the cart - see screenshots to illustrate.

      Do I need to do something special to make sure the player is positioned right?

      This sounds very much like an old Bukkit bug: https://bukkit.atlassian.net/browse/BUKKIT-5351 - but that's from two years ago, with no further updates.

            Unassigned Unassigned
            bigpresh David Precious
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: