File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -206,16 +206,22 @@ relay.on('connect', player => {
206
206
console .log (' New connection' , player .connection .address )
207
207
208
208
// Server is sending a message to the client.
209
- player .on (' clientbound' , ({ name, params }) => {
209
+ player .on (' clientbound' , ({ name, params }, des ) => {
210
210
if (name === ' disconnect' ) { // Intercept kick
211
211
params .message = ' Intercepted' // Change kick message to "Intercepted"
212
212
}
213
213
})
214
214
// Client is sending a message to the server
215
- player .on (' serverbound' , ({ name, params }) => {
215
+ player .on (' serverbound' , ({ name, params }, des ) => {
216
216
if (name === ' text' ) { // Intercept chat message to server and append time.
217
217
params .message += ` , on ${ new Date ().toLocaleString ()} `
218
218
}
219
+
220
+ if (name === ' command_request' ) { // Intercept command request to server and cancel if its "/test"
221
+ if (params .command == " /test" ) {
222
+ des .canceled = true
223
+ }
224
+ }
219
225
})
220
226
})
221
227
```
You can’t perform that action at this time.
0 commit comments