Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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.

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
}

  • 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.

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.

  • 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

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.

  • 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.

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.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.