the first int is the id (which you got)
the second one is a string that determines which block the pressure plate will get its texture from
the third one is the material
the forth one is an EnumMobType that will activate the pressure plate
so the code is
new QuartzPressurPlate(190, "quartzBlock" /*because that is the quartz block's unlocalized name*/, Material.rock /*because that is the material quartz is*/, EnumMobType.mobs /*this will make it so that only mobs can activate the pressure plate, the other EnumMobTypes are player (which only players can activate it) and everything (all entities)*/)
if the comments are in the way, here is the code
new QuartzPressurPlate(190, "quartzBlock", Material.rock , EnumMobType.mobs)
thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, PaleocraftDimension.PaleocraftDimension, new TeleporterPaleocraft(thePlayer.mcServer.worldServerForDimension(PaleocraftDimension.PaleocraftDimension)));
thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, new TeleporterPaleocraft(thePlayer.mcServer.worldServerForDimension(0)));
So I made my item a food item, but I still am not sure how to add a healing attribute to it. (:
make an item using this class the same way you would do with a normal food item
public class ItemHealingFood extends ItemFood
{
public ItemHealingFood(int par1, int par2, float par3, boolean par4)
{
super(par1, par2, par3, par4);
this.setHasSubtypes(true);
}
protected void onFoodEaten(ItemStack par1ItemStack, World par World, EntityPlayer par3EntityPlayer)
{
if (!par2World.isRemote)
{
par3EntityPlayer.heal(5);
//or any amount that you want
}
}
}
I kinda figured out how to make it have "infinite durability"
First do this
("ENDERMITE", Integer.MAX_VALUE, new int[]{12, 32, 24, 12}, 40);
Although it would look as if it simply gives the armor a crap ton of durability, the chestplate doesn't seem to be taking damage when I try it.
If you're afraid that the other armor pieces will *eventually* run out, create a tick handler that sets the damage to 0 every tick. I have the code for it if you ever need it.
this below will allow flight if item is right clicked and deny if its right clicked agian
put it at the bottom of the item that u want the player to right click
first of all, you don't need == true
second of all, you don't need the .inventory.hasItem(this.itemID) because if it isn't in the inventory, how can it access this method.
third of all, just do this !tempPlayer.capabilities.allowFlying
same with the other method
I don't know how to find the nearest opaque block, but I know how to make it place a rose on the location where the player dies.
@ForgeSubscribe
public void placeBlock(final LivingDeathEvent event)
{
if (event.entityLiving instanceof EntityPlayer)
{
int x = MathHelper.floor_double(event.entityLiving.posX);
int y = MathHelper.floor_double(event.entityLiving.posY);
int z = MathHelper.floor_double(event.entityLiving.posZ);
event.entityLiving.worldObj.setBlock(x, y, z, Block.plantRed.blockID);
}
}
par2 is the x position of the bed
par3 is the y position of the bed
par4 is the z position of the bed
looking on the sleepInBedAt method, I find these
this.sleeping = true;
this.playerLocation = new ChunkCoordinates(par1, par2, par3);
par1 is the x position of the bed
par2 is the y position of the bed
par3 is the z position of the bed
now the isPlayerSleeping method returns the sleeping variable
the onUpdate method uses the isPlayerSleeping method
looking in the onUpdate method, I find this
this.wakeUpPlayer(false, true, true);
in the wakeUpPlayer method i find this
this.setSpawnChunk(this.playerLocation, false);
recall that the playerLocation variable contains the coordinates of the bed
in the setSpawnChunk method, it sets a variable called spawnChunk to the given coordinates
spawnChunk now has a the coordinates of the spawn however because of
private ChunkCoordinates spawnChunk;
I cannot use it
but when I search for all methods that use spawnChunk I find a method called getBedLocation which returns spawnChunk
The way you have will work for underground too. Instead of using getSpawnPoint().posY, use the Y position you want instead.
For instance, if you want it to find block layer 32, you would do this:
int x = par1Entity.worldObj.getSpawnPoint().posX
int y = 32
int z = par1Entity.worldObj.getSpawnPoint().posZ
actually ignore what I said about spawning underground that isn't what I am worrying about
those are the coordinates of the original spawn, but not the spawn for the player because that might be changed like using /spawnpoint or a bed
1
the first int is the id (which you got)
the second one is a string that determines which block the pressure plate will get its texture from
the third one is the material
the forth one is an EnumMobType that will activate the pressure plate
so the code is
if the comments are in the way, here is the code
0
i think you need to change this to
also change
to
2
instead of Item.coal
0
0
nope
unless you somehow recreate crafting
0
1
make an item using this class the same way you would do with a normal food item
0
0
put it in the @Init method
0
First do this
Although it would look as if it simply gives the armor a crap ton of durability, the chestplate doesn't seem to be taking damage when I try it.
If you're afraid that the other armor pieces will *eventually* run out, create a tick handler that sets the damage to 0 every tick. I have the code for it if you ever need it.
0
Although this will work, there is a bunch of unneeded things.
First of all,
this is unneeded because of this
par3 is already an instance of EntityPlayer
also this,
first of all, you don't need == true
second of all, you don't need the .inventory.hasItem(this.itemID) because if it isn't in the inventory, how can it access this method.
third of all, just do this !tempPlayer.capabilities.allowFlying
same with the other method
0
1
0
ok I just did and I found the solution
first I looked in the onBlockActivated method and I find this statement
par2 is the x position of the bed
par3 is the y position of the bed
par4 is the z position of the bed
looking on the sleepInBedAt method, I find these
par1 is the x position of the bed
par2 is the y position of the bed
par3 is the z position of the bed
now the isPlayerSleeping method returns the sleeping variable
the onUpdate method uses the isPlayerSleeping method
looking in the onUpdate method, I find this
in the wakeUpPlayer method i find this
recall that the playerLocation variable contains the coordinates of the bed
in the setSpawnChunk method, it sets a variable called spawnChunk to the given coordinates
spawnChunk now has a the coordinates of the spawn however because of
I cannot use it
but when I search for all methods that use spawnChunk I find a method called getBedLocation which returns spawnChunk
and I use
0
actually ignore what I said about spawning underground that isn't what I am worrying about
those are the coordinates of the original spawn, but not the spawn for the player because that might be changed like using /spawnpoint or a bed