Fatal error with GarnetBowItem.java when compiling

Started by ItsNovaLOL on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 21:42, 23. Jun 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Fatal error with GarnetBowItem.java when compiling

I'm following a tutorial on how to animate a bow pulling (https://mcreator.net/forum/74855/tutorial-how-animate-custom-bow-pulling-116) I was at the end of step 2/3 when I got this error:

C:\Users\bvgof\MCreatorWorkspaces\stonepatch\src\main\java\com\novianexpress\stonepatch\item\GarnetBowItem.java:200: error: class, interface, or enum expected

public static ArrowCustomEntity shoot(World world, LivingEntity entity, Random random, float power, double damage, int knockback) {
^

This is the code where I think it's from btw:

public static ArrowCustomEntity shoot(World world, LivingEntity entity, Random random, float power, double damage, int knockback) {
        ArrowCustomEntity entityarrow = new ArrowCustomEntity(arrow, entity, world);
        entityarrow.shoot(entity.getLookVec().x, entity.getLookVec().y, entity.getLookVec().z, power * 2, 0);
        entityarrow.setSilent(true);
        entityarrow.setIsCritical(true);
        entityarrow.setDamage(damage);
        entityarrow.setKnockbackStrength(knockback);
        world.addEntity(entityarrow);
        double x = entity.getPosX();
        double y = entity.getPosY();
        double z = entity.getPosZ();
        world.playSound((PlayerEntity) null, (double) x, (double) y, (double) z,
                (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.arrow.shoot")),
                SoundCategory.PLAYERS, 1, 1f / (random.nextFloat() * 0.5f + 1) + (power / 2));
        return entityarrow;
}
Last seen on 21:42, 23. Jun 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, the shoot() method is…
Tue, 03/22/2022 - 10:44

Also, the shoot() method is in the ArrowCustomEntity class in GarnetBowItem.java.

Last seen on 21:42, 23. Jun 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nvm found out there an extra…
Tue, 03/22/2022 - 20:30

nvm found out there an extra closing curly bracket, it's working now.