Is there really no methods that anyone knows of that checks this?
Try this:
int x = (int) Math.floor(living.posX);
int y = (int) (living.posY - living.getYOffset());
int z = (int) Math.floor(living.posZ);
if (living.worldObj.getBlockId(x, y - 1, z) == BLOCKIDTOCHECK && living.worldObj.getBlockId(x, y, z) == 0)
{
if (living.motionY < 0 && living.boundingBox.minY < y)
{
living.onGround() = true;
//CODE THAT YOU TO DO
}
Living would obviously be your EntityLiving parameter.
int x = (int) Math.floor(living.posX);
int y = (int) (living.posY - living.getYOffset());
int z = (int) Math.floor(living.posZ);
if (living.worldObj.getBlockId(x, y - 1, z) == BLOCKIDTOCHECK && living.worldObj.getBlockId(x, y, z) == 0)
{
if (living.motionY < 0 && living.boundingBox.minY < y)
{
living.onGround() = true;
//CODE THAT YOU TO DO
}
Living would obviously be your EntityLiving parameter.
Is there a way to return the block and give it a property? Like change the light level while the player is standing on it? I'm trying to do dynamic lights if you can't tell
Is there a way to return the block and give it a property? Like change the light level while the player is standing on it? I'm trying to do dynamic lights if you can't tell
Oh, well in that case look at BlockRedstoneOre, all you need to know should be in there.
A method that does what? Just put the code i posted in a ticking handler.
A simple method that checks the block that the player is standing on? For example:
if (EntityLiving.getItemStack(whatever that method is) == someItem.itemID)
{
EntityLiving.getTheBlockThatTheDudeIsStandingOn.changeLightLevelstuff.some more code
}
A simple method that checks the block that the player is standing on? For example:
if (EntityLiving.getItemStack(whatever that method is) == someItem.itemID)
{
EntityLiving.getTheBlockThatTheDudeIsStandingOn.changeLightLevelstuff.some more code
}
Exactly. Thats what this does.
int x = (int) Math.floor(living.posX);
int y = (int) (living.posY - living.getYOffset());
int z = (int) Math.floor(living.posZ);
if (living.worldObj.getBlockId(x, y - 1, z) == BLOCKIDTOCHECK && living.worldObj.getBlockId(x, y, z) == 0)
{
if (living.motionY < 0 && living.boundingBox.minY < y)
{
living.onGround() = true;
//CODE THAT YOU TO DO
}
int x = (int) Math.floor(living.posX);
int y = (int) (living.posY - living.getYOffset());
int z = (int) Math.floor(living.posZ);
if (living.worldObj.getBlockId(x, y - 1, z) == BLOCKIDTOCHECK && living.worldObj.getBlockId(x, y, z) == 0)
{
if (living.motionY < 0 && living.boundingBox.minY < y)
{
living.onGround() = true;
//CODE THAT YOU TO DO
}
Oh XD I see it now. Sorry one more thing, do you know if it's possible to check if a dimension has been visited?
That depends on what you need it for. Would you be able to use NBT?
I could yes. Basically I just need a line of code to be fired (EntityRegistry.addSpawn) when the nether portal is open, and remove it when it's not. I figured checking if the player has been to the dimension, or is in the dimension, would work. But, now that I think about it, checking if the portal block exists would work better. Or it could be fired on the lighting of the portal. The method doesn't have to be removed after it's been fired, it works for me either way. I've been googling and poking around in the src code for a while now. No luck. I know I would have to use tick updates so it continually checks to see if the block exists. Or if it were to activate on portal ignition, I wouldn't need to use tick updates.
And, if you know how, how would I check the item the player is holding?
Thanks guys
Yes.
^^ Click the Signature to go to my page. (: ^^
WOW
d: Thought you'd want to know!
^^ Click the Signature to go to my page. (: ^^
Try this:
Living would obviously be your EntityLiving parameter.
Is there a way to return the block and give it a property? Like change the light level while the player is standing on it? I'm trying to do dynamic lights if you can't tell
Oh, well in that case look at BlockRedstoneOre, all you need to know should be in there.
But how would I get the block instead of calling just one block?
Oh, you mean detecting for just all blocks? You would probably throw that code in your ticking handler.
Well I know that much is there a method that does this?
A method that does what? Just put the code i posted in a ticking handler.
A simple method that checks the block that the player is standing on? For example:
Exactly. Thats what this does.
Oh XD I see it now. Sorry one more thing, do you know if it's possible to check if a dimension has been visited?
I could yes. Basically I just need a line of code to be fired (EntityRegistry.addSpawn) when the nether portal is open, and remove it when it's not. I figured checking if the player has been to the dimension, or is in the dimension, would work. But, now that I think about it, checking if the portal block exists would work better. Or it could be fired on the lighting of the portal. The method doesn't have to be removed after it's been fired, it works for me either way. I've been googling and poking around in the src code for a while now. No luck. I know I would have to use tick updates so it continually checks to see if the block exists. Or if it were to activate on portal ignition, I wouldn't need to use tick updates.