Hi guys, do you know any way to disable collision between boats? I want specific boats to not collide with each other. I tried adding them to the team with collisionRule set to 'never', but that doesn't disable the collision. I can't find any way to do it with API too. Is there any way to do it?
Hmm im not sure minecraft allows you to make changes on vanilla physics especially collision between entitys
Then it might be possible,sadly im not familiar on this part of the minecraft so i cant help you much You can try and check for similar problems from the past,you might find an answer
I did search for similar issues, but I only found questions about boats colliding with terrain and checking for collisions. I am interested only in disabling the collision completely between boats (or between a given boat and every entity). Something like https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#setCollidable-boolean- but for boats would be perfect.
You can only disable collisions for living entity unfortunately. If you wanna make just juste use a plugin of mine that I made (check on my resource page) that delete every entity collisions. Since it is not a living entity though, I don’t think it’s gonna work. Check for java reflection maybe?
public void setCollisionCancelled(boolean cancel) Found this in https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.html Not familiar with this event but at first glance it seems you might be able to cancel the collision? Not sure what it would do but this is what I found.
This event cancellation doesn't seem to do much for the boats. Even if it did, I would like the client to know that specified boat is not collidable. Without that, this cancellation would work the same as in cancelling movement or block break - the client assumes the action is not cancelled and then the changes are reverted by the server. I want the boats to pass smoothly through each other though.
That's a shame. For the people in the future: If now it is changed and the boat collision may be disabled, please write a reply to this post, thank you in advance!
Code (Java): @EventHandler public void onBoatCollision(VehicleEntityCollisionEvent event) { Entity vehicle = event.getEntity(); if(vehicle.getType().equals(EntityType.BOAT)) { event.setCollisionCancelled(true); event.setCancelled(true); } } See if this works for you.
I see what I did. Code (Java): @EventHandler public void onBoatCollision(VehicleEntityCollisionEvent event) { Entity vehicle = event.getVehicle(); /* It's VehicleEntityCollisionEvent.getVehicle() not .getEntity()*/ if(vehicle.getType().equals(EntityType.BOAT)) { event.setCollisionCancelled(true); event.setCancelled(true); } }