ForgeEvents.onEvent("net.minecraftforge.event.entity.EntityTravelToDimensionEvent", event => {
    let entity = event.entity
    if (entity.type.toString() !== 'minecraft:player') return
    if (event.dimension.path.toString() !== 'overworld') return
    let server = entity.server
    let currentDayTime = server.getLevel('overworld').time.toString()
    let currentDay = Math.trunc(currentDayTime / 24000) - 1
    server.runCommandSilent(`ecliptic solar set ${currentDay}`)
})