Jump to content

[1.16.4]How would i make a sword that explodes the player is used on another mob?


Recommended Posts

Posted (edited)

I have a sword all made up, and I have tried different ways of achieving this effect I want.
in sense I'm making this to be a troll item. if the user attacks any kind of mob. it would instead blow up the said user.
My knowledge in modding varies on certain things, like making blocks and items. I honestly have no idea where to start when it comes to giving said things the ability to explode.

Any help would be amazing.

Edited by SeraphicKing
Posted
10 minutes ago, diesieben07 said:

Override hitEntity in your item class to do something when hitting an entity with it.

Use World#createExplosion to create an explosion.

Thanks for the reply, i will try this out soon.

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.