类 CommandEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.CommandEvent
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
public class CommandEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.bus.api.ICancellableEvent
CommandEvent is fired after a command is parsed, but before it is executed.
This event is fired during the invocation of
Commands.performCommand(ParseResults, String)
.
This event is cancellable, and does not
.
If the event is cancelled, the command will not be executed.
引用无效
have a result
This event is fired on the main Forge event bus, only on the logical server.
-
字段概要
字段修饰符和类型字段说明private @Nullable Throwable
private com.mojang.brigadier.ParseResults
<CommandSourceStack> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明@Nullable Throwable
返回 an exception to be thrown when performing the command, starts null。com.mojang.brigadier.ParseResults
<CommandSourceStack> 返回 the parsed command results。void
setException
(@Nullable Throwable exception) void
setParseResults
(com.mojang.brigadier.ParseResults<CommandSourceStack> parse) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
parse
-
exception
-
-
构造器详细资料
-
CommandEvent
-
-
方法详细资料
-
getParseResults
返回 the parsed command results。- 返回:
- the parsed command results
-
setParseResults
-
getException
返回 an exception to be thrown when performing the command, starts null。- 返回:
- an exception to be thrown when performing the command, starts null
-
setException
-