-
Bug
-
Resolution: Invalid
-
None
-
1.14.0.9
-
None
-
Amazon Linux, JavaScript
Hello,
I am running a bedrock dedicated server. I am tapping into Scripting API to learn about its possibilities.
I have created an addon which works perfectly fine on the local game copy, but it fails to fully operate on the server. The behaviour is quite strange, so I searched for a resolution but to no avail.
When I say fully, I mean that the Client Script side works fine, but the Server Script side does not respond at all. As if it didn't exist.
I tried a few variants finally resorting to the bare minimum which simply listens for an event and then displays a message in the chat. That didn't work either.
Again, the Client Script works and if I call a chat message in the "minecraft:client_entered_world" event, it shows just fine.
I have been pulling my hairs out for a few days now trying to find the root of the issue. Then I waved a white flag and came here.
- I checked server file permissions to make sure the server can execute all its files.
- I tried to run the addon from [server]/behavior_packs, [server]/worlds/[world]/behavior_packs
- I experimented with versions and other settings in JSON files e.g. valid_known_packs.json or world_behavior_packs.json
- I tried installing the addon manually but also importing the world from the local game copy to the server
- I enabled/disable the experimental game mode on the server.
- ... and everything in between.
Noting did the trick. Below I attach my code and server details so you can join in and see yourself.
What am I missing?
Address: 52.16.178.68
Port: 25655
const system = client.registerSystem(0, 0); system.initialize = function() { this.listenForEvent("minecraft:client_entered_world", (eventData) => this.onStartSetup(eventData)); this.registerEventData("Kox:startSetup", {}); }; system.onStartSetup = function(eventData) { let playerData = this.createEventData("Kox:startSetup"); playerData.data = eventData.data; this.broadcastEvent("Kox:startSetup", playerData); };
var system = server.registerSystem(0, 0); system.initialize = function () { this.listenForEvent("Kox:startSetup", eventData => this.onStartServerSetup(eventData)); }; system.onStartServerSetup = function (eventData) { let chatEventData = this.createEventData("minecraft:display_chat_event"); chatEventData.data.message = "Yes, I am here!"; this.broadcastEvent("minecraft:display_chat_event", chatEventData); };