You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/create-commands/executors/native-sender.md
+20-1
Original file line number
Diff line number
Diff line change
@@ -67,4 +67,23 @@ This can now be used via the following command examples:
67
67
/execute in minecraft:overworld positioned 20 60 -20 run break
68
68
```
69
69
70
-
::::
70
+
::::
71
+
72
+
## Constructing a `NativeProxyCommandSender`
73
+
74
+
You can create a `NativeProxyCommandSender` object yourself using the static `from` method:
75
+
76
+
```java
77
+
NativeProxyCommandSender from(CommandSender caller, CommandSender callee, Location location, World world);
78
+
```
79
+
80
+
This `CommandSender` will work the same as any other `NativeProxyCommandSender` you would get while using `executesNative`. For example, you could use it to make a simple version of `/execute`, like so:
`NativeProxyCommandSender` used to be a class, but this version changed it to an interface. Any code compiled against an earlier version that references any method of `NativeProxyCommandSender` may throw the following `IncompatibleClassChangeError` when run using the new version of the API:
2
+
3
+
```
4
+
java.lang.IncompatibleClassChangeError: Found interface dev.jorel.commandapi.wrappers.NativeProxyCommandSender, but class was expected
5
+
```
6
+
7
+
If this happens, the original code simply needs to be recompiled using the new API version.
8
+
9
+
Additionally, the constructor of `NativeProxyCommandSender` is no longer available. Instead, the static `from` method should be used:
0 commit comments