Jump to content

Recommended Posts

Posted

So im trying to make onitemrightclick stun entitys in a radius and have no idea how, im using a custom tooltype and its in 1.16.4. Also is there a way to make the player have to hold right click for x time to activate it.

Posted

Its definitely possible to have an item requiring the player to hold right click for some time in order to use it. Think for example the bow, or foods. You would need to override the method getUseDuration and return the value you want. Then you would need to override the onItemUseFinish method to handle the logic of your item. As for the logic itself, if you want to stun entities in a certain radius from the player you could just use World#getEntitiesWithinAABB and do whatever you want with the Entities that you get from the method

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

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.