Posted December 12, 20213 yr @OnlyIn(Dist.CLIENT) @SubscribeEvent public static void onPreRenderPlayer(final RenderPlayerEvent.Pre event) { System.out.println("on client: " + player.level.isNight()); } @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { System.out.println("on server: " + player.level.isNight()); } I want to know if it's day or night On the server, this is valid but client,invalid [12十二月2021 12:43:55.102] [Render thread/INFO] [STDOUT/]: [ocean.chinacraft.common.item.armor.SilkNightArmor$RenderNightArmor:onPreRenderPlayer:79]: on client: false [12十二月2021 12:43:55.118] [Render thread/INFO] [STDOUT/]: [ocean.chinacraft.common.item.armor.SilkNightArmor$RenderNightArmor:onPreRenderPlayer:79]: on client: false [12:45:31] [Server thread/INFO] [STDOUT/]: [ocean.chinacraft.common.item.armor.SilkNightArmor$NightArmor:onArmorTick:61]: on server: true [12:45:31] [Server thread/INFO] [STDOUT/]: [ocean.chinacraft.common.item.armor.SilkNightArmor$NightArmor:onArmorTick:61]: on server: true [12:45:31] [Server thread/INFO] [STDOUT/]: [ocean.chinacraft.common.item.armor.SilkNightArmor$NightArmor:onArmorTick:61]: on server: true Edited December 12, 20213 yr by Spring
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.