Interface IMinecartCollisionHandler


public interface IMinecartCollisionHandler
This class defines a replacement for the default minecart collision code. Only one handler can be registered at a time. It it registered with AbstractMinecartEntity.registerCollisionHandler(). If you use this, make it a configuration option.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.phys.AABB
    getBoundingBox(net.minecraft.world.entity.vehicle.AbstractMinecart cart)
    This function replaces the function of the same name in EntityMinecart.
    net.minecraft.world.phys.AABB
    getCollisionBox(net.minecraft.world.entity.vehicle.AbstractMinecart cart, net.minecraft.world.entity.Entity other)
    This function replaced the function of the same name in EntityMinecart.
    net.minecraft.world.phys.AABB
    getMinecartCollisionBox(net.minecraft.world.entity.vehicle.AbstractMinecart cart)
    This function is used to define the box used for detecting minecart collisions.
    void
    onEntityCollision(net.minecraft.world.entity.vehicle.AbstractMinecart cart, net.minecraft.world.entity.Entity other)
    This basically replaces the function of the same name in EntityMinecart.
  • Method Details

    • onEntityCollision

      void onEntityCollision(net.minecraft.world.entity.vehicle.AbstractMinecart cart, net.minecraft.world.entity.Entity other)
      This basically replaces the function of the same name in EntityMinecart. Code in IMinecartHooks.applyEntityCollisionHook is still run.
      Parameters:
      cart - The cart that called the collision.
      other - The object it collided with.
    • getCollisionBox

      net.minecraft.world.phys.AABB getCollisionBox(net.minecraft.world.entity.vehicle.AbstractMinecart cart, net.minecraft.world.entity.Entity other)
      This function replaced the function of the same name in EntityMinecart. It is used to define whether minecarts collide with specific entities, for example items.
      Parameters:
      cart - The cart for which the collision box was requested.
      other - The entity requesting the collision box.
      Returns:
      The collision box or null.
    • getMinecartCollisionBox

      net.minecraft.world.phys.AABB getMinecartCollisionBox(net.minecraft.world.entity.vehicle.AbstractMinecart cart)
      This function is used to define the box used for detecting minecart collisions. It is generally bigger that the normal collision box.
      Parameters:
      cart - The cart for which the collision box was requested.
      Returns:
      The collision box, cannot be null.
    • getBoundingBox

      net.minecraft.world.phys.AABB getBoundingBox(net.minecraft.world.entity.vehicle.AbstractMinecart cart)
      This function replaces the function of the same name in EntityMinecart. It defines whether minecarts are solid to the player.
      Parameters:
      cart - The cart for which the bounding box was requested.
      Returns:
      The bounding box or null.