Jump to content

Recommended Posts

Posted

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"

Posted

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/

Posted

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"

Posted

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.

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.