Solved Disable player pushing/stoping/colliding a minecart

Discussion in 'Plugin Development' started by fireboyev, Feb 23, 2017.

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

    fireboyev

    Hey all, I was wondering how to stop the player from pushing a minecart. I tried using Player#setCollidable(), that didn't work. I tried using the VehicleEntityCollisionEvent and canceling it, but the player doesn't trigger that event for some reason, only normal entities do. I would prefer not getting an answer of "Not possible" because I have seen other servers do it. I would be totally fine with using nms or something to find a way around this problem.
     
  2. Offline

    Zombie_Striker

    @fireboyev
    You need to set collidable to false for both the player and the minecart.
     
  3. Offline

    fireboyev

    Only LivingEntity has that method and a minecart can't be cast to it. Got any other options?

    -EDIT-
    I just got the BukkitRunnable to give it a constant (every 2 ticks) velocity instead of every 10 ticks.
    Now it is working, thanks for your help.
     
    Last edited: Feb 23, 2017
Thread Status:
Not open for further replies.

Share This Page