#[1.16.5] Event not Loading ( 'player.chat' )

43 messages · Page 1 of 1 (latest)

wise sierra
#

I was trying to create some commands using the "player.chat" event inside the server_scripts, I even put it on top priority but for some reason it doesn't load

On the log it shows it was loaded but it wasn't working, so I tried adding a console.log inside the event callback but it didn't print on the log, what could be the reason?

raven tartanBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

wise sierra
#

on the log it shows ```
[10:46:43] [INFO ] SourceFile:33: Loaded script server_scripts:jmm/kubejs/clearLag/chatCommands.js in 0.007 s

#

and then on the end of the log, where the console.logs were supposed to show up ```
[10:47:07] [INFO ] Added recipes in 762.6 ms
[10:47:07] [INFO ] Added 19075 recipes, removed 4706 recipes, modified 3903 recipes, with 5 failed recipes and 0 fall-backed recipes
[10:47:13] [INFO ] [functions] Found 0 tags, added 0 objects, removed 0 objects
[10:47:13] [INFO ] [functions] Found 0 tags, added 0 objects, removed 0 objects
[10:47:29] [INFO ] server_scripts:jmm/kubejs/clearLag/clearLag.js:85: SERVER.LOAD

#

and the code inside the "chatCommands.js" is a bunch of functions and then on the bottom of the file, on the line 127 it has ```js
onEvent(player.chat, event => {
console.log(PLAYER.CHAT EVENT)
// etc etc

#

the "clearLag.js" has also a bunch of functions and then on the line 84 it has: ```js
onEvent('server.load', event => {
console.log(SERVER.LOAD)
// etc etc

#

I don't see what could be the problem, why isn't the event being loaded?

#

(even when I send a message on the chat it wasn't showing up)

wise sierra
#

Note: when I try in another instance it works just fine, just when I try on my modpack it doesn't work, could it be because it has A LOT of scripts?

#

tested again outside the modpack and it worked, what could be the reason?

meager dock
#

send your full latest.log

wise sierra
#

Okay hold on

tribal mistBOT
#

Paste version of latest.log from @wise sierra

wise sierra
#

I ask my friend to test those things that's why I took some time to send the log, had to ask her to send it (she has a better computer)

#

also I'm sorry for being annoying, I'm just a little tired of trying to make this work the whole day 😅

#

I actually have difficult asking for help... so yea... sorry, that's all I wanted to say

meager dock
#

@split dawn do you guys still do bugfixes on 1.16? this seems like a bug hmmm

wise sierra
fleet heron
#

are you using ftb ranks

#

if so it's probably that

#

ranks cancels the chat event

wise sierra
#

oooh they do? T-T

#

so I should remove the mod or is there a way to work around that?

fleet heron
#

i... don't remember honestly

wise sierra
#

oof T-T

#

I found something

#

[1.16.5] 'player.chat' - Event not Loading

#

[1.16.5] Event not Loading ( 'player.chat' )

sonic gate
#

there isnt a workaround

wise sierra
#

so the only way to fix it is by removing FTB Ranks....? 🤔

#

this unless they make a bugfix or something, which I don't think they'll be doing... sadly

heavy crow
#

Since you are using Forge you could listen to the forge event, which may or may not still be hook-able with FTB Ranks installed, but that’s my last ditch thought

sonic gate
#

thats the event ftb ranks cancels

#

if you could listen on a higher priority than ftb ranks, tho i dont think thats possible with kubejs

heavy crow
#

It is possible iirc.
It’s just janky

wise sierra
#

oh damn but then how would it be?

heavy crow
#
const EVENT_BUS_ONE = java("net.minecraftforge.common.MinecraftForge").EVENT_BUS;
EVENT_BUS_ONE.addListener('HIGHEST', true, EVENT_BUS_ONE.getClass().forName('net.minecraftforge.event.ServerChatEvent'), (event) => {
    global["serverchat"](event);
});
global["serverchat"] = function(event){
    console.log("SERVER CHAT EVENT FIRED!");
    console.log(event.username);
    console.log(event.player);
    console.log(event.message);
    let player = event.player.asKJS();
}
wise sierra
#

Oh thank you ❤️

raven tartanBOT
#

@wise sierra Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!