public static final SimpleCommandExceptionType ERROR_NOT_A_WAYPOINT = new SimpleCommandExceptionType(Component.translatable("argument.waypoint.invalid"));
13
14
public static WaypointTransmitter getWaypoint(final CommandContext<CommandSourceStack> context, final String name) throws CommandSyntaxException {
15
if (context.getArgument(name, EntitySelector.class).findSingleEntity(context.getSource()) instanceof WaypointTransmitter waypointTransmitter) {
16
return waypointTransmitter;
17
} else {
18
throw ERROR_NOT_A_WAYPOINT.create();
19
}
20
}
21
}
22
Decompiled Minecraft 26.3 source of WaypointArgument (net/minecraft/commands/arguments/WaypointArgument.java) with Mojang official mappings, stored verbatim on the site.