Initial commit

This commit is contained in:
2025-11-14 15:07:01 +01:00
commit 8c7f3ea7f9
35 changed files with 3225 additions and 0 deletions
@@ -0,0 +1,23 @@
package net.fretux.mindmotion.event;
import net.fretux.mindmotion.player.PlayerCapabilityProvider;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber(modid = "mindmotion")
public class CombatEvents {
@SubscribeEvent
public static void onEntityHurt(LivingHurtEvent event) {
if (event.getEntity() instanceof net.minecraft.world.entity.player.Player player) {
player.getCapability(PlayerCapabilityProvider.TEMPO).ifPresent(tempo -> tempo.addTempo(3));
PlayerTickHandler.markCombat(player);
}
if (event.getSource().getEntity() instanceof net.minecraft.world.entity.player.Player attacker) {
attacker.getCapability(PlayerCapabilityProvider.TEMPO).ifPresent(tempo -> tempo.addTempo(4));
PlayerTickHandler.markCombat(attacker);
}
}
}