Hey! I have been developing a mod and one of the features is an enchantment called Jousting that goes on your sword that gives you extra damage while on a horse, after a while I figured out how to detect if the player is on a horse but, actually it is probably better for you to just look at the code, but it isn't working, that and for the life of me I don't understand the damage source system, much appreciation in advance!
Worth noting I am using forge API and the version is 1.20.1
public class JoustingEnchantment extends Enchantment {
public JoustingEnchantment(Rarity pRarity, EnchantmentCategory pCategory, EquipmentSlot... pApplicableSlots) {
super(pRarity, EnchantmentCategory.WEAPON, pApplicableSlots);
}
@Override
public void doPostAttack(LivingEntity pAttacker, Entity pTarget, int pLevel) {
if (pAttacker.isPassenger()) {
Hey! I have been developing a mod and one of the features is an enchantment called Jousting that goes on your sword that gives you extra damage while on a horse, after a while I figured out how to detect if the player is on a horse but, actually it is probably better for you to just look at the code, but it isn't working, that and for the life of me I don't understand the damage source system, much appreciation in advance!
Worth noting I am using forge API and the version is 1.20.1