Posted December 31, 201410 yr Hi! How would I get the block that a player right clicked? I want this to work only when I have a certain (custom) item in my hand. How would I achieve this?
December 31, 201410 yr Override onItemUse 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.
December 31, 201410 yr Hi! How would I get the block that a player right clicked? I want this to work only when I have a certain (custom) item in my hand. How would I achieve this? you use the onBlockActivated method, like this @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(player.getHeldItem() != null && player.getHeldItem().getItem() == YOURITEMHERE){ //Do SOMETHING Here }
December 31, 201410 yr Author Override onItemUse How do you use the params? (Sorry, I am really new to Modding).
December 31, 201410 yr Author Hi! How would I get the block that a player right clicked? I want this to work only when I have a certain (custom) item in my hand. How would I achieve this? you use the onBlockActivated method, like this @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(player.getHeldItem() != null && player.getHeldItem().getItem() == YOURITEMHERE){ //Do SOMETHING Here } Stack traces for days.
December 31, 201410 yr The itemstack, the player, the world, the x/y/z location that was clicked on, the side that was clicked, then the float version of the coordinates (x/y/z), which are not round integers (e.g. if you click the center of the top face of a block you'll get 123.5, 66.0, 432.5). 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.
December 31, 201410 yr Author The itemstack, the player, the world, the x/y/z location that was clicked on, the side that was clicked, then the float version of the coordinates (x/y/z), which are not round integers (e.g. if you click the center of the top face of a block you'll get 123.5, 66.0, 432.5). Bit off topic but; why is there a red explanation mark on my project? http://prntscr.com/5n1vvt
December 31, 201410 yr That means there's an error that will prevent the project from launching. If its not in the source code, then there's an issue with the build path. Right click -> build path -> configure and look for more ! in that window. 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.
December 31, 201410 yr Author That means there's an error that will prevent the project from launching. If its not in the source code, then there's an issue with the build path. Right click -> build path -> configure and look for more ! in that window. I have had the error before; I fixed it following the steps you showed above^ I tried it again and it doesn't seem to be working this time.
December 31, 201410 yr I had the exclamation point thing happen to me before too, when I was trying to figure out how to compile my mod. I fixed it by restoring an older copy. If you do restore an older version, backup your textures because it deleted my textures when I did. The proud(ish) developer of Ancients
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.