Class in @minecraft/server
Extends Error
Thrown when an entity or player that’s gone is used.
import { InvalidEntityError } from '@minecraft/server';Example
Section titled “Example”import { InvalidEntityError } from '@minecraft/server';
try { // Call the API here.} catch (error) { if (error instanceof InvalidEntityError) { console.warn(`${error.name}: ${error.message}`); } else { throw error; }}import { InvalidEntityError } from '@minecraft/server';
try { // Call the API here.}catch (error) { if (error instanceof InvalidEntityError) { console.warn(`${error.name}: ${error.message}`); } else { throw error; }}