Posted July 11, 20205 yr Hi, I'm trying to make a simple item that, when you hold it in your main hand and right click on a living entity, will kill the entity and spawn an entity of the same type in your location. So if you right click on a pig, the pig will die and a second, new pig will spawn on you. It seems to me that making such a simple item would be incredibly complicated with forge. You'd need to raytrace on the client-side to find the mob, tell the server about the mob through networking, kill the mob, then spawn a new one. Is there something I'm missing? Do you really need to set up networking for such a simple item? How would you do this? Thank you!
July 11, 20205 yr Use PlayerInteractEvent$EntityInteractSpecific. From there, kill the entity and add a new one. Right clicking entities is handled by the specific entity when interacted with.
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.