American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

2 PM – Minecraft Modding With Java

February 27, 2021 @ 2:00 pm - 3:00 pm

  1. We made the Saturn Axe spits out fireball.
  2. Homework:
    1. Inside SaturnFireballAxe.java add the following code
      1. public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) {
            target.setFire(5);
            return super.hitEntity(stack, target, attacker);
        }
      2. You might need to do some import if it is not automatically done by IntelliJ
      3. import net.minecraft.item.*;
    2. Inside ModItems.java, reduce the attack damage of your SaturnSword from 10 to 2.
    3. Start your Minecraft from intelliJ
    4. Summon any creature. For example, to summon an enderman, you can use the following command
      1. /summon minecraft:enderman
    5. Try hitting the creature using your Saturn Axe LEFT click (not RIGHT click). If you did it properly, when you hit the enderman using the Saturn Axe, the creature should have been burn by the Axe.
    6. If it works, change the code instead of target.setFire(5); do below and see what happen to the creature when you hit using the axe (LEFT click)
      target.setNoGravity(true);

Details

Date:
February 27, 2021
Time:
2:00 pm - 3:00 pm
Event Categories:
,