Jump to content

Dropping an Item for the Entity


DanilaFE

Recommended Posts

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"

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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"

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.

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.