mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
23 lines
553 B
Rust
23 lines
553 B
Rust
use pumpkin_macros::{Event, cancellable};
|
|
|
|
/// An event that occurs when a projectile is launched.
|
|
#[cancellable]
|
|
#[derive(Event, Clone)]
|
|
pub struct ProjectileLaunchEvent {
|
|
/// The ID of the projectile entity.
|
|
pub entity_id: i32,
|
|
/// The ID of the shooter entity if applicable.
|
|
pub shooter_id: Option<i32>,
|
|
}
|
|
|
|
impl ProjectileLaunchEvent {
|
|
#[must_use]
|
|
pub const fn new(entity_id: i32, shooter_id: Option<i32>) -> Self {
|
|
Self {
|
|
entity_id,
|
|
shooter_id,
|
|
cancelled: false,
|
|
}
|
|
}
|
|
}
|