Posted February 29, 20169 yr sorry i'm korean i can't write english very well.. i want to on Right-click event get aiming target class. (Player or Monster All..) How to? Please Answer me T__T
February 29, 20169 yr Look into the EntityEndermen file. The Endermen notice you if you look at him. catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
February 29, 20169 yr Author sorry i can't english very well.. When Right Click Other Player, I want to Get that player class..T__T
February 29, 20169 yr 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.
February 29, 20169 yr Then use the EntityInteractEvent and check if the target given by the Event is a player catch(Exception e) { } Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).
February 29, 20169 yr Author someVariable.class ? sorry, i can't english very well.. When Right Click Other Player, I want to Get that this Player Object class.. or, if right click Zombie, I want to Get Zombie Object class
February 29, 20169 yr 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.
February 29, 20169 yr 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/
February 29, 20169 yr 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/
February 29, 20169 yr 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.
March 1, 20169 yr Author 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.
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.