Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/08/23 in all areas

  1. PlayerTickEvents fire twice per tick, once with a START phase and later with an END phase. As well as checking event.side, also check that event.phase matches the phase you want it to occur in. I have a ticking capability very similar to yours, this is how I do it: @SubscribeEvent public static void tick(TickEvent.PlayerTickEvent event) { if(event.side == LogicalSide.SERVER && event.phase == TickEvent.Phase.END) { event.player.getCapability(CombatTimeCapability.INSTANCE).ifPresent(CombatTimeCapabilityInterface::tickCombat); } }
    1 point
  2. The reviveCaps() worked for me. I'm using forge 37.0.67. My Clone Event: public static void onDeath(PlayerEvent.Clone event) { if (event.isWasDeath()) { event.getOriginal().reviveCaps(); event.getOriginal().getCapability(ModCapabilityImpl.MOD_CAPABILITY).ifPresent(oldStore -> { event.getEntity().getCapability(ModCapabilityImpl.MOD_CAPABILITY).ifPresent(newStore -> { newStore.copyForRespawn((ModCapabilityImpl) oldStore); }); }); event.getOriginal().invalidateCaps(); } } In my IModCapability: void copyForRespawn(ModCapabilityImpl oldStore); In my ModCapabilityImpl: @Override public void copyForRespawn(ModCapabilityImpl oldStore) { this.value = oldStore.value; } Hope this helps!
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.