ExecutionCommandSource .java

net.minecraft.commands.ExecutionCommandSource (interface): members: clearCallbacks, resultConsumer, withCallback, handleError, isSilent, dispatcher.

net.minecraft.commandsinterface35 linescommonextends ExecutionCommandSource<T>>1.3 KB

API Surface (0)

No public/protected methods detected (fields or constants only).

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ExecutionCommandSource.java35 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.commands;
2
3
import com.mojang.brigadier.CommandDispatcher;
4
import com.mojang.brigadier.Message;
5
import com.mojang.brigadier.ResultConsumer;
6
import com.mojang.brigadier.exceptions.CommandExceptionType;
7
import com.mojang.brigadier.exceptions.CommandSyntaxException;
8
import net.minecraft.commands.execution.TraceCallbacks;
9
import net.minecraft.server.permissions.PermissionSetSupplier;
10
import org.jspecify.annotations.Nullable;
11
12
public interface ExecutionCommandSource<T extends ExecutionCommandSource<T>> extends PermissionSetSupplier {
13
	T withCallback(CommandResultCallback resultCallback);
14
15
	CommandResultCallback callback();
16
17
	default T clearCallbacks() {
18
		return this.withCallback(CommandResultCallback.EMPTY);
19
	}
20
21
	CommandDispatcher<T> dispatcher();
22
23
	void handleError(CommandExceptionType type, Message message, boolean forked, @Nullable TraceCallbacks tracer);
24
25
	boolean isSilent();
26
27
	default void handleError(final CommandSyntaxException e, final boolean forked, final @Nullable TraceCallbacks tracer) {
28
		this.handleError(e.getType(), e.getRawMessage(), forked, tracer);
29
	}
30
31
	static <T extends ExecutionCommandSource<T>> ResultConsumer<T> resultConsumer() {
32
		return (context, success, result) -> context.getSource().callback().onResult(success, result);
33
	}
34
}
35

Decompiled Minecraft 26.3 source of ExecutionCommandSource (net/minecraft/commands/ExecutionCommandSource.java) with Mojang official mappings, stored verbatim on the site.