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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi, i'm really having problems trying to set the texture to my custom item. I thought i'm doing everything correctly, but all i see is the missing texture block for my item. I am trying this for over a week now and getting really frustrated. The only time i could make the texture work, was when i used an older Forge version (52.0.1) for Minecraft (1.21.4). Was there a fundamental change for textures and models somewhere between versions that i'm missing? I started with Forge 54.1.0 and had this problem, so in my frustration i tried many things: Upgrading to Forge 54.1.1, created multiple new projects, workspaces, redownloaded everything and setting things up multiple times, as it was suggested in an older thread. Therea are no errors in the console logs, but maybe i'm blind, so i pasted the console logs to pastebin anyway: https://pastebin.com/zAM8RiUN The only time i see an error is when i change the models JSON file to an incorrect JSON which makes sense and that suggests to me it is actually reading the JSON file.   I set the github repository to public, i would be so thankful if anyone could take a look and tell me what i did wrong: https://github.com/xLorkin/teleport_pug_forge   As a note: i'm pretty new to modding, this is my first mod ever. But i'm used to programming. I had some up and downs, but through reading the documentation, using google and experimenting, i could solve all other problems. I only started modding for Minecraft because my son is such a big fan and wanted this mod.
    • Please read the FAQ (link in orange bar at top of page), and post logs as described there.
    • Hello fellow Minecrafters! I recently returned to Minecraft and realized I needed a wiki that displays basic information easily and had great user navigation. That’s why I decided to build: MinecraftSearch — a site by a Minecraft fan, for Minecraft fans. Key Features So Far Straight-to-the-Point Info: No extra fluff; just the essentials on items, mobs, recipes, loot and more. Clean & Intuitive Layout: Easy navigation so you spend less time scrolling and more time playing. Optimized Search: Search for anything—items, mobs, blocks—and get results instantly. What I’m Thinking of Adding More data/information: Catch chances for fishing rod, traveling villager trades, biomes info and a lot more. The website is still under development and need a lot more data added. Community Contributions: Potential for user-uploaded tips for items/mobs/blocks in the future. Feature Requests Welcome: Your ideas could shape how the wiki evolves! You can see my roadmap at the About page https://minecraftsearch.com/about I’d love for you to check out MinecraftSearch and see if it helps you find the info you need faster. Feedback is crucial—I want to develop this further based on what the community needs most, so please let me know what you think. Thanks, and happy crafting!
    • Instructions on how to install newer Java can be found in the FAQ
    • That's just plain wrong... newer versions are much better optimised and start a lot faster than 1.8.9, both Forge and Minecraft itself. Comparing Fabric 1.21 with Forge 1.8 is like comparing apples and oranges... one's brand new and the other's over a decade old.
  • Topics

×
×
  • Create New...

Important Information

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