I have a client side fabric mod. It uses SimpleConfig to store it’s configuration and the state of the inbuilt client-side night vision. I want to re-enable the client side night vision as soon as the player has respawned, like this:
if (ModConfigs.NV_STATUS) {
assert MinecraftClient.getInstance().player != null;
MinecraftClient.getInstance().player.addStatusEffect(new StatusEffectInstance(StatusEffects.NIGHT_VISION, -1));
}
Does anybody know how I can achieve this?
I’ve already tried to use mixins to inject this code into the requestRespawn
method of the class ClientPlayerEntity
, which didn’t work. I also didn’t find any client-side event listeners for it.
MarioS271 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.