Jump to content

[1.7.10] Check if player steps on Block


K1llM3Pl5

Recommended Posts

I know this may be a really old version, but it's the version that I like the most.

I'm having a small problem: I want to create a Block that, when the player steps on, it adds a PotionEffect on the player.

It's kinda simple, but my code isn't working for some reason, and I can't find it.

public void getBlockPlayerIsStanding(EntityPlayer player)
	{
		World world = player.worldObj;
		Block block = world.getBlock((int)player.posX, (int)player.posY - 1, (int)player.posZ);
		if(block == Specialization.blockSpeedPod)
		{
			player.addPotionEffect(new PotionEffect(1, 5, 1));
		} 
		
	}

I would really like a second opinion here.

And sorry if my English is bad, I'm from Brazil.

 

Link to comment
Share on other sites

1.7 is no longer supported here. Update to 1.12 or newer.

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

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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