Skip to content

objects.cancelEdit

Closes a player’s active or opening editor and discards its draft.

objects.cancelEdit(player: PlayerTarget): Promise<ActionResult>
Name Type Description
player PlayerTarget The player editing an object.

An ActionResult. Returns object-edit-not-active if the player has no edit session.

gamemodes/my-mode.ts
import { commands, objects } from "nativemp";
commands.register("endedit", (player) => {
void objects.cancelEdit(player);
});