Basically my previous project/mod was using snapshots mappings, the current project I have uses mojangs mappings, for some reason it isn't working, Here are some examples below:
My current code (mojang mappings, which doesn't work):
public static final RegistryObject<Item> DECLESE_SWORD = ITEMS.register("declese_sword",
() -> new SwordItem(ModItemTier.DECLESE, 2, -2.4f,
new Item.Properties().tab(ModItemGroup.FRV_GROUP))
{
@Override
public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker)
{
if(!attacker.level.isClientSide())
{
target.addEffect(new EffectInstance(Effects.POISON, 100, 1));
}
return super.hurtEnemy(stack, target, attacker);
}
});
And the old working code (Snapshot mappings):
public static final RegistryObject<Item> CORRUPT_SWORD = ITEMS.register("corrupt_sword",
() -> new SwordItem(ModItemTier.CORRUPT, 90, -2f,
new Item.Properties().isImmuneToFire().group(ModItemGroup.FRV_GROUP))
{
@Override
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) {
if(!attacker.world.isRemote()) {
target.addPotionEffect(new EffectInstance(Effects.WITHER, 1000, 2));
target.addPotionEffect(new EffectInstance(Effects.SLOWNESS, 1000, 2));
target.addPotionEffect(new EffectInstance(Effects.POISON, 1000, 2));
}
return super.hitEntity(stack, target, attacker);
}
});
What could be the cause of it?