#Execute code at same time client and server side

9 messages · Page 1 of 1 (latest)

sullen heron
#

On my previous modpack i have used tags to connect jei hide and automatically remove recipes
client side
server side

but it will cause some issue , so i'm wondering if there was other ways

gilded vaporBOT
#

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

hollow iron
#

keep in mind that

client loads startup and client scripts
server loads startup and server scripts

I use the global on startup (with high priority) and reference that on server/client

for example a script named
global_constants.js

// priority 100
global.hideItems = [
  "minecraft:stone",
  "minecraft:oak_log"
]

now you can loop

global.hideItems.forEach(id => {
  // use id for something 
}

use them on server or client side without any problem. just make sure it is lower priority than where you populated the variable

light cosmos
#

also keep in mind that client will load before server heh

#

same with startup, server always loads last

hollow iron
#

that is not an issue

light cosmos
#

ofc it's not, I'm just pointing that out

sullen heron