Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I am trying to add a few custom arrows for a project i'm currently working on.

I have the classes all there and setup however there are some errors on a couple of constructors (see below)


import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.projectile.AbstractArrow;
import net.minecraft.world.entity.projectile.Arrow;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.EntityHitResult;
import org.multicoder.mcpaintball.init.entityinit;

public class RedPaintballArrowEntity extends Arrow
{

    public RedPaintballArrowEntity(EntityType<? extends RedPaintballArrowEntity> p_36858_, Level p_36859_) {
        super(p_36858_, p_36859_);
    }

    public RedPaintballArrowEntity(Level p_36861_, double p_36862_, double p_36863_, double p_36864_) {
        super(entityinit.RED_PAINTBALL.get(),p_36861_, p_36862_, p_36863_, p_36864_);
    }

    public RedPaintballArrowEntity(Level p_36866_, LivingEntity p_36867_) {
        super(entityinit.RED_PAINTBALL.get(), p_36866_, p_36867_);
    }

    @Override
    protected ItemStack getPickupItem()
    {
        return ItemStack.EMPTY;
    }

    @Override
    protected void onHitEntity(EntityHitResult p_36757_)
    {

    }
}

The error is with the bottom 2 constructors and it is saying cannot resolve method 'super', I am completely stuck on what to do or why this is happening to begin with. Am I missing something.

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.multicoder.mcpaintball.MCPaintball;
import org.multicoder.mcpaintball.entity.RedPaintballArrowEntity;

public class entityinit
{
    public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITIES, MCPaintball.MODID);

    public static final RegistryObject<EntityType<RedPaintballArrowEntity>> RED_PAINTBALL = ENTITY_TYPES.register("red_paintball",() -> EntityType.Builder.of(RedPaintballArrowEntity::new, MobCategory.MISC).sized(0.5f,0.5f).build("red_paintball"));
}

This is my entitytype register.

As the compiler is telling you, those constructors don't exist.

They do exist on AbstractArrow, but you aren't extending that class.


Please don't post basic java questions in this forum. Buy a book or whatever you need to learn the language.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.comย  You should also read the support forum sticky post.

  • Author

Right I was not aware of the abstract arrow was what had both constructors. I thought that both abstract arrow and arrow has both constructors

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.