Posted July 2, 201411 yr Alright, this is my second post on this topic but it's asking a different question. Using entity.setCurrentItemOrArmor or entity.dropItem client-side only, surprisingly, only affects the client. However, because the Minecraft.getMinecraft().objectMouseOver.entityHit is client-only. Therefore, to successfully get an entity at which the player is looking, you can only be in a "remote" world, but from there, firing the two of the above methods doesn't do much, since it's not the server entities that are "dropping" an item. How do I make it so that right-clicking an entity that the player is looking at (a vanilla entity), will make it "drop" an item? “Since when did you start modding?” “Last night"
July 2, 201411 yr Is the attacked entity a custom one or are you changing drops for a vanilla entity? Anyway there are several server side methods and fields. I think you should look at the attackEntityFrom method. Alternatively you can handle the living drops event, especially if you're changing vanilla drops. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
July 2, 201411 yr Author How do I make it so that right-clicking an entity that the player is looking at (a vanilla entity), will make it "drop" an item? Vanilla entity, being right-clicked, not attacked. “Since when did you start modding?” “Last night"
July 2, 201411 yr I would recomend you to check out the EntityVillager class. It has the method if you right click on them a gui opens up. Change it to spawn an item to the world or player and you are good to go.
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.