List<Entity> list = this.world.getOtherEntities(this, this.getBoundingBox().expand(0.2f, -0.01f, 0.2f), EntityPredicates.canBePushedBy(this));
if (!list.isEmpty()) {
boolean bl = !this.world.isClient && !(this.getPrimaryPassenger() instanceof PlayerEntity);
for (int j = 0; j < list.size(); ++j) {
Entity entity = list.get(j);
if (entity.hasPassenger(this)) continue;
if (bl && this.getPassengerList().size() < this.getMaxPassengers() && !entity.hasVehicle() && entity.getWidth() < this.getWidth() && entity instanceof LivingEntity && !(entity instanceof WaterCreatureEntity) && !(entity instanceof PlayerEntity)) {
entity.startRiding(this);
continue;
}
this.pushAwayFrom(entity);
}
}
(From BoatEntity.tick())
When the execution falls into the block where entity.startRiding(this); is in, the boat won't try to push the entity anymore. Normally, the entity should start riding the boat now, but it may fail because of the presence or riding cooldown or that the boat is submerged in water.
How to reproduce
Place a boat on the ground, and push it to a corner.
Summon a llama (or anything similar) riding a minecraft.
Let the llama disamount near the boat so that it should be pushed by the boat and have a riding cooldown of 3 seconds.
Discover that the llama is not pushed for 3 seconds before it can ride the boat.
Possible Soluton:
Use something like the code below instead.
if (bl && this.getPassengerList().size() < this.getMaxPassengers() && !entity.hasVehicle() && entity.getWidth() < this.getWidth() && entity instanceof LivingEntity && !(entity instanceof WaterCreatureEntity) && !(entity instanceof PlayerEntity) && entity.canStartRiding(this) && this.canAddPassenger(entity))
Attachments
Comments 3
Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Please provide reliable steps to reproduce this issue, and a video showcasing the behavior if possible.