Started by
ItsNovaLOL
on
Topic category: Troubleshooting, bugs, and solutions
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; }
Also, the shoot() method is in the ArrowCustomEntity class in GarnetBowItem.java.
nvm found out there an extra closing curly bracket, it's working now.