Interface in @minecraft/server
Extends PlayerViolationAfterEvent, CancellableEvent
Basalt’s own: cancelled, the player stays and the check starts counting again.
import type { PlayerViolationBeforeEvent } from '@minecraft/server';Subscribe to it with world.beforeEvents.playerViolation.
Example
Section titled “Example”import { world, type PlayerViolationBeforeEvent } from '@minecraft/server';
world.beforeEvents.playerViolation.subscribe((event: PlayerViolationBeforeEvent) => { console.log('playerViolation', event.player.name, event.check, event.detail);
// Uncomment to stop it from happening. // event.cancel = true;});import { world } from '@minecraft/server';
world.beforeEvents.playerViolation.subscribe((event) => { console.log('playerViolation', event.player.name, event.check, event.detail);
// Uncomment to stop it from happening. // event.cancel = true;});Used by
Section titled “Used by”WorldBeforeEvents.playerViolation
Inherited
Section titled “Inherited”From PlayerViolationAfterEvent: player, check, detail
From CancellableEvent: cancel