Jump to content

[1.7.10] Right Click Event..


jmylifecolor

Recommended Posts

someVariable.class

?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

BTW

 

@jmylifecolor I highly recommend you to learn english when posting to any english forums. Just a suggesion. Have a nice day. :)

Sorry, if you find mistaches in my posts.

I am not EN.

And when I post anything on Modder support, it means, I can't help myself and I need your help. And when you decide to delete my topic, just PM me with the reason, please.

Link to comment
Share on other sites

As mentioned, whenever you are trying to intercept vanilla behavior you should see if there is an event that can help you. Forge has provided a lot of events for the common things that people would like to modify such as breaking blocks, interacting with entities, joining a world, and so on.

 

In this case the event you need to handle is EntityInteractEvent. You need to write a handler method that is annotated to subscribe to the event bus, you need the class with the method to be registered as an event handling class, and inside the method you can take the event parameter that is passed in and look at its fields. It will tell you the entity that is being interacted with, and you can then check what class the entity is.

 

I have a tutorial on handling events: http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-event-handling.html

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

BTW

 

@jmylifecolor I highly recommend you to learn english when posting to any english forums. Just a suggesion. Have a nice day. :)

 

Well his English is better than our Korean! I don't think English is the problem, I think he just isn't that familiar with modding, especially event handling, and maybe programming.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

There are a few concepts that aren't making it across the translation barrier.

 

The first has to do with programming in general (not that I think that jmylifecolor doesn't know java or how to program, but rather that the terminology itself may not be translating correctly).  The second has to deal with event handlers, which are a little arcane if you haven't used them before.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Oh! i have Object-Oriented Programming(JAVA,C#) Skill. but, i think  my english expression is problem.

 

I understand the event. just i want to get target's classes(EntityPlayerMP) when i click right button to other user(target)..

 

today first time I tried Forge-Programming.  sorry.

 

Thanks to everyone Answer.

 

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.