Jump to content

[1.6.4][SOLVED]How to make an Item effective only against a certain block


Recommended Posts

Posted

Well if your Item extends Item (anywhere in its hierarchy), then in the Item class there's getStrVsBlock

 

Use that

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.

Posted

This might seem stupid, but what do I make it return if I want it to mine Obsidian in 0.5 seconds(10 ticks)

I know it goes like

public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block){
return ????;
}

The question marks are what I don't know. I think it's a number, like 2.0F

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

Might want to start with a number greater than 1.

 

If its too slow, make the number bigger.  If its too fast, make the number smaller.

 

(Note: bare-handed strength is approximately 0.25)

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.

Posted

if(par2Block == Blocks.obsidian) ?

 

Seriously dude, basic Java.

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.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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