Started by
Elip1
on
Topic category: Help with Minecraft modding (Java Edition)
I have been trying to make a spear that you throw put I can't get it to leave my infintory and stick in the ground like a trident. could someone please help me with this?
At the first, to make the spear, have you seen this video? https://youtu.be/8bwVzvJJbxA, and for sticking into the ground i don't know...https://mcreator.net/tracker/issue/65955 can't normally be done, but you can find some way to position the spear/item whit a function triggered when block get's hit (for now ain't found nothing)
Thank you!
I know I'm late, but for anyone seeing this now, there is a solution:
Lock the element code of the projectile;
Remove the @Override that says when InGround, discard
Add instead:
@Override
protected ItemStack getPickupItem() {
return new ItemStack(YourModNameModItems.spearitemname.get());
}
P.S.: Credit: I kinda stole this from How to Make Custom Arrows (TUTORIAL).
P.P.S.: Also for some reason you cannot pick up the item, it gives you air. Maybe I did something wrong. I'm working on this.