Jump to content

[1.16.5] Simulating using different items


Recommended Posts

I'm trying to create a mod that allows the player/entities to equip a tool and use the tool whenever whatever they're doing seems like it needs the tool. For example, I want them to be able to equip a pickaxe and whenever they're mining without a tool, the blocks break as fast as with the pickaxe and fortune or whatever is applied. Of course I'm trying to make this work for multiple tools at the same time to make it a bit more useful. I was able to cover breaking and harvesting blocks with the PlayerEvent.BreakSpeed and PlayerEvent.HarvestCheck events, but I realized that this was not very reliable when trying to modify attack damage and with possible other modded items. I want the effects of the tool to also carry over, like with sweeping with swords and enchantments. Unless I code all the enchantments and other effects manually, I don't see how to do this. Is there any way I could basically simulate the player using a different item to attack or break blocks that would support any item? 

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.

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.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.