/* * Copyright (c) Forge Development LLC and contributors * SPDX-License-Identifier: LGPL-2.1-only */ package net.minecraftforge.event; import com.mojang.brigadier.ParseResults; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.Cancelable; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.fml.LogicalSide; import org.jetbrains.annotations.Nullable; /** * CommandEvent is fired after a command is parsed, but before it is executed. * This event is fired during the invocation of {@link Commands#performCommand(ParseResults, String)}. *
* This event is {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}. * If the event is cancelled, the command will not be executed. *
* This event is fired on the {@linkplain MinecraftForge#EVENT_BUS main Forge event bus},
* only on the {@linkplain LogicalSide#SERVER logical server}.
**/
@Cancelable
public class CommandEvent extends Event
{
private ParseResults