Skip to content

Class endstone::ActorCollideWithActorEvent

ClassList > endstone > ActorCollideWithActorEvent

Called when two Actors collide with each other. More...

  • #include <endstone/event/actor/actor_collide_with_actor_event.h>

Inherits the following classes: endstone::Cancellable

Public Functions

Type Name
ActorCollideWithActorEvent (const NotNull< Actor > & actor1, const NotNull< Actor > & actor2)
ENDSTONE_EVENT (ActorCollideWithActorEvent)
const std::vector< NotNull< Actor > > & getActors () const
Returns the Actors involved in this event.

Public Functions inherited from endstone::Cancellable

See endstone::Cancellable

Type Name
virtual void cancel ()
Cancel this event.
virtual bool isCancelled () override const
Gets the cancellation state of this event.
virtual void setCancelled (bool cancel) override
Sets the cancellation state of this event.

Public Functions inherited from endstone::ICancellable

See endstone::ICancellable

Type Name
virtual void cancel () = 0
Cancels this event.
virtual bool isCancelled () const = 0
Gets the cancellation state of this event.
virtual void setCancelled (bool cancel) = 0
Sets the cancellation state of this event.
virtual ~ICancellable () = default

Detailed Description

If this event is cancelled, the Actors will not be pushed away from each other. Cancelling also stops either Actor from being pulled onto the other when the other is a rideable vehicle, so a listener that cancels every collision also stops boats and minecarts from being boarded by walking into them.

The server fires this before it decides whether the collision leads to a push, so it is also called for pairs the server then leaves alone, and it is called more than once per tick for a pair that keeps overlapping.

Public Functions Documentation

function ActorCollideWithActorEvent

inline endstone::ActorCollideWithActorEvent::ActorCollideWithActorEvent (
    const  NotNull < Actor > & actor1,
    const  NotNull < Actor > & actor2
) 

function ENDSTONE_EVENT

endstone::ActorCollideWithActorEvent::ENDSTONE_EVENT (
    ActorCollideWithActorEvent
) 

function getActors

Returns the Actors involved in this event.

inline const std::vector< NotNull < Actor > > & endstone::ActorCollideWithActorEvent::getActors () const

Returns:

Actors that are involved in this event



The documentation for this class was generated from the following file include/endstone/event/actor/actor_collide_with_actor_event.h