类 RegisterClientCommandsEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RegisterClientCommandsEvent
public class RegisterClientCommandsEvent
extends net.minecraftforge.eventbus.api.Event
Fired to allow mods to register client commands.
Some command arguments behave differently for the client commands dispatcher:
-
引用无效
ResourceLocationArgument#getAdvancement(com.mojang.brigadier.context.CommandContext, String)
ObjectiveArgument.getObjective(com.mojang.brigadier.context.CommandContext, String)
only returns objectives that are displayed to the player.
This event is not cancellable, and does not have a result.
This event is fired on the main Forge event bus, only on the logical client.
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段修饰符和类型字段说明private final CommandBuildContext
private final com.mojang.brigadier.CommandDispatcher
<CommandSourceStack> -
构造器概要
构造器构造器说明RegisterClientCommandsEvent
(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
方法概要
修饰符和类型方法说明返回 the context to build the commands for。com.mojang.brigadier.CommandDispatcher
<CommandSourceStack> 返回 the command dispatcher for registering commands to be executed on the client。从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
dispatcher
-
context
-
-
构造器详细资料
-
RegisterClientCommandsEvent
@Internal public RegisterClientCommandsEvent(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context)
-
-
方法详细资料
-
getDispatcher
返回 the command dispatcher for registering commands to be executed on the client。- 返回:
- the command dispatcher for registering commands to be executed on the client
-
getBuildContext
返回 the context to build the commands for。- 返回:
- the context to build the commands for
-