Jump to content

Recommended Posts

Posted

The

ItemBow

is using

instanceof

checks, meaning that if you make your arrow extend

ItemArrow

, it should work fine.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

I came across this error, what should I do? "Don't know how to add class mod.cbultimate.stranded.entity.EntityDullArrow"

 

package mod.cbultimate.stranded.entity;//Created by CBU on 22/1/2017.

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class EntityDullArrow extends EntityArrow {
    public EntityDullArrow(World worldIn) {
        super(worldIn);
    }

    public EntityDullArrow(World worldIn, double x, double y, double z) {
        super(worldIn, x, y, z);
    }

    public EntityDullArrow(World worldIn, EntityLivingBase shooter) {
        super(worldIn, shooter);
    }

    @Override
    protected ItemStack getArrowStack() {
        return null;
    }
}

 

 

package mod.cbultimate.stranded.item;//Created by CBU on 22/1/2017.

import mod.cbultimate.stranded.entity.EntityDullArrow;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class ItemDullArrow extends ItemArrow {

    @Override
    public EntityArrow createArrow(World worldIn, ItemStack stack, EntityLivingBase shooter) {
        EntityDullArrow entityDullArrow = new EntityDullArrow(worldIn, shooter);
        entityDullArrow.setDamage(1);
        entityDullArrow.setKnockbackStrength(0);
        entityDullArrow.pickupStatus = EntityArrow.PickupStatus.DISALLOWED;
        return entityDullArrow;
    }
}

 

[04:29:25] [server thread/ERROR]: "Silently" catching entity tracking error.
net.minecraft.util.ReportedException: Adding entity to track
at net.minecraft.entity.EntityTracker.addEntityToTracker(EntityTracker.java:259) [EntityTracker.class:?]
at net.minecraft.entity.EntityTracker.trackEntity(EntityTracker.java:101) [EntityTracker.class:?]
at net.minecraft.world.ServerWorldEventHandler.onEntityAdded(ServerWorldEventHandler.java:43) [serverWorldEventHandler.class:?]
at net.minecraft.world.World.onEntityAdded(World.java:1304) [World.class:?]
at net.minecraft.world.WorldServer.onEntityAdded(WorldServer.java:1179) [WorldServer.class:?]
at net.minecraft.world.World.spawnEntityInWorld(World.java:1295) [World.class:?]
at net.minecraft.world.WorldServer.spawnEntityInWorld(WorldServer.java:1125) [WorldServer.class:?]
at net.minecraft.item.ItemBow.onPlayerStoppedUsing(ItemBow.java:143) [itemBow.class:?]
at net.minecraft.item.ItemStack.onPlayerStoppedUsing(ItemStack.java:528) [itemStack.class:?]
at net.minecraft.entity.EntityLivingBase.stopActiveHand(EntityLivingBase.java:2985) [EntityLivingBase.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:626) [NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:56) [CPacketPlayerDigging.class:?]
at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:12) [CPacketPlayerDigging.class:?]
at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) [PacketThreadUtil$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111]
at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:753) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.lang.IllegalArgumentException: Don't know how to add class mod.cbultimate.stranded.entity.EntityDullArrow!
at net.minecraft.entity.EntityTrackerEntry.createSpawnPacket(EntityTrackerEntry.java:670) ~[EntityTrackerEntry.class:?]
at net.minecraft.entity.EntityTrackerEntry.updatePlayerEntity(EntityTrackerEntry.java:391) ~[EntityTrackerEntry.class:?]
at net.minecraft.entity.EntityTrackerEntry.updatePlayerEntities(EntityTrackerEntry.java:501) ~[EntityTrackerEntry.class:?]
at net.minecraft.entity.EntityTracker.addEntityToTracker(EntityTracker.java:233) ~[EntityTracker.class:?]
... 21 more

Posted

It crashes when I try to start it.

 

EntityRegistry.registerModEntity(new ResourceLocation(StrandedMod.MODID, "dull_arrow"), EntityDullArrow.class, "entity_dull_arrow", 1, StrandedMod.class,1, 1, false);

 

Where should I register the entity? I tried to register it in FMLPreInitializationEvent.

Posted
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Stranded Mod (cbu_strandedmod)
Caused by: java.lang.NullPointerException
at net.minecraftforge.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:183)
at net.minecraftforge.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149)
at mod.cbultimate.stranded.item.ModItems.registerItems(ModItems.java:49)
at mod.cbultimate.stranded.item.ModItems.preInit(ModItems.java:36)
at mod.cbultimate.stranded.StrandedMod.preInit(StrandedMod.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:621)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:243)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:145)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:615)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:264)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:476)
at net.minecraft.client.Minecraft.run(Minecraft.java:385)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Posted

You have to use your

@Mod.Instance

variable instead of passing

StrandedMod.class

to

EntityRegistry#registerModEntity

.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Is this what you mean?

 

EntityRegistry.registerModEntity(new ResourceLocation(StrandedMod.MODID, "dull_arrow"), EntityDullArrow.class, "entity_dull_arrow", 1, "mod.cbultimate.stranded.StrandedMod",1, 1, false);

 

 

Posted

No, your

@Mod.Instance

variable you have in your

@Mod

class... You do have one right? It is a simple variable of your main mod class, with

@Mod.Instance

it, much like how

@SidedProxy

works.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

My arrow entity is a white box, how do I fix that?

How do I use the resource location of vanilla Minecraft arrows?

 

EntityRegistry.registerModEntity(new ResourceLocation(StrandedMod.MODID, "dull_arrow"), EntityDullArrow.class, "entity_dull_arrow", 1, StrandedMod.instance,16, 1, false);

 

Posted

I'm trying to make the Renderer for the custom arrow but it gets quite complicated with RenderManager. How do I just use Minecraft's Vanilla Arrow Renderer?

 

        RenderingRegistry.registerEntityRenderingHandler(EntityDullArrow.class, new RenderDullArrow()); // RenderDullArrow() requires RenderManager

 

package mod.cbultimate.stranded.entity;

import net.minecraft.client.renderer.entity.RenderArrow;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RenderDullArrow extends RenderArrow<EntityDullArrow>
{
    public static final ResourceLocation RES_ARROW = new ResourceLocation("textures/entity/projectiles/arrow.png");

    public RenderDullArrow(RenderManager renderManagerIn) {
        super(renderManagerIn);
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(EntityDullArrow entity)
    {
        return RES_ARROW;
    }
}

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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