Jump to content

Feroov

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Feroov

  1. There are no errors, the game runs fine, when I hit any entity it just doesn't apply the effect
  2. 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?
  3. Ok then fair enough, but still thank you so much
  4. Yes everything works it's just that if i have absorption, it will insta heal the player back, which is game breaking you become lets say invincible, I wanted to make it in a way when you take damage, you still have the absorption effect but empty hearts if that makes sense, lets say you ate a golden apple and took damage, you know how the hearts still stay but blacked out, same logic here how I want hope that makes sense
  5. Hello everyone, so currently my onArmorTick as of now works but not the way I want, basically it is on a constant, for example if I have absorption, lets say it is on always 0:10 seconds and when I do take damage, instantly the absorption regens (basically invincible). Here is my code: @Override public void onArmorTick(ItemStack stack, World world, PlayerEntity player) { if(!world.isClientSide) { boolean hasPlayerAbsorptionEffect = !Objects.equals(player.getEffect(Effects.ABSORPTION), null); if(player.getItemBySlot(EquipmentSlotType.HEAD).getItem() == ModItems.OCLUTRIUM_HELMET.get() && player.getItemBySlot(EquipmentSlotType.CHEST).getItem() == ModItems.OCLUTRIUM_CHESTPLATE.get() && player.getItemBySlot(EquipmentSlotType.LEGS).getItem() == ModItems.OCLUTRIUM_LEGGINGS.get() && player.getItemBySlot(EquipmentSlotType.FEET).getItem() == ModItems.OCLUTRIUM_BOOTS.get() ) player.addEffect(new EffectInstance(Effects.ABSORPTION, 200, 2)); super.onArmorTick(stack, world, player); } } Cheers!
×
×
  • Create New...

Important Information

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