Jump to content

[1.12.2] Creating a throwable item that sticks in the ground, like an arrow


Dizzlepop12

Recommended Posts

I'm trying to create a throwable item that sticks in the ground and can be picked up, like an arrow. However, when I right click the item in-game, it catches an exception, saying that the constructor that I'm calling in my Item class doesn't exist in my entity class, even though it does. Any help?

 

Log: https://pastebin.com/yw3i0wsq

Entity class: https://github.com/TheSlayerMC/Journey-1.12/blob/86e5e7f2b7c3c6c7975d9e0b48e33e4a64a1c20b/main/java/net/journey/entity/projectile/EntityCharredKnife.java

Item class: https://github.com/TheSlayerMC/Journey-1.12/blob/86e5e7f2b7c3c6c7975d9e0b48e33e4a64a1c20b/main/java/net/journey/items/ItemThrowableArrow.java

Item registry: https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/journey/JourneyItems.java#L1462

 

Example of a throwable item that does work:

 

Entity class: https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/journey/entity/projectile/EntityCorbaPiercer.java

Item class: https://github.com/TheSlayerMC/Journey-1.12/blob/master/main/java/net/journey/items/ItemPiercer.java

Edited by Dizzlepop12
Link to comment
Share on other sites

28 minutes ago, Dizzlepop12 said:

Any help?

For one EntitySizzlingKnife is an abstract class.

And it doesnt contain a constructor World, EntityLivingBase, float, int

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

8 minutes ago, Animefan8888 said:

For one EntitySizzlingKnife is an abstract class.

And it doesnt contain a constructor World, EntityLivingBase, float, int

That's because I started with the EntityCharredKnife class first as a test, the rest of the knife entity classes are older versions and don't have the same code. If you look at the EntityCharredKnife class, it's not abstract and it does contain the correct constructor, and that's the one I tested it with.

Link to comment
Share on other sites

1 minute ago, Dizzlepop12 said:

That's because I started with the EntityCharredKnife class first as a test, the rest of the knife entity classes are older versions and don't have the same code. If you look at the EntityCharredKnife class, it's not abstract and it does contain the correct constructor, and that's the one I tested it with.

Not according to the crash report.

"net.journey.entity.projectile.EntitySizzlingKnife.<init>(net.minecraft.world.World, net.minecraft.entity.EntityLivingBase, float, int)"

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

4 minutes ago, Animefan8888 said:

Not according to the crash report.

"net.journey.entity.projectile.EntitySizzlingKnife.<init>(net.minecraft.world.World, net.minecraft.entity.EntityLivingBase, float, int)"

Ohh you right, when I use the charred knife it doesn't throw any kind of exception, it just doesn't do anything.

Link to comment
Share on other sites

13 minutes ago, Dizzlepop12 said:

Ohh you right, when I use the charred knife it doesn't throw any kind of exception, it just doesn't do anything.

Step through it with your IDEs debugger and you'll be able to confirm if it is being spawned at all, or if it is rendering at all.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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.