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.

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

Featured Replies

Posted

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

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.

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

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.

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

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.

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.