Posted April 3, 201411 yr I have a quick question, if I have a method in the block class doesn't have a parameter I need, how can I add a parameter to it with it still getting called? If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author The method is public void updateTick(World world, int x, int y, int z, Random random) The parameter I need is EntityPlayer. I need my block to scan for players in a radius of a few blocks. If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author I tough about that yesturday but I forgot to try it. Thanks for the fast help! If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author In: world.getClosestVulnerablePlayer(1, x, y, z) What does the 1 stand for? Is it the gamemode? If so, when I have it at 1, does that mean that players with gamemode 1 will be counted or anything that isn't 1? If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author Ok, so this is the code I used, and it didn't work. Nothing happend. public void updateTick(World world, int x, int y, int z, Random random) { EntityPlayer player = world.getClosestVulnerablePlayer(5, x, y, z); if(player != null) { System.out.println("gf"); } } Ohh yeah, sorry for posting this here but, when I log out and back in, my block isn't there. If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author It still doesn't work, it doesn't even do anything. If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author I have a tile entity, I also custom render my block. So should I put that code in the tileentity class? If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author But there is no method called updateTick so it won't get called in the tileentity If I helped then you help, hit that Thank You button or Applaud.
April 3, 201411 yr Author I found it but I wasn't sure will that do the job since it didn't have the parameters. If I helped then you help, hit that Thank You button or Applaud.
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.