• 1

    posted a message on Pressure Plate
    Quote from WaterMinecraft

    new QuartzPressurPlate(190, null, null, null)

    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)
    Posted in: Modification Development
  • 0

    posted a message on (FORGE 1.5.1) Custom Dimension takes me to the nether
    thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, PaleocraftDimension.PaleocraftDimension);

    i think you need to change this to
    thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, PaleocraftDimension.PaleocraftDimension, new TeleporterPaleocraft(thePlayer.mcServer.worldServerForDimension(PaleocraftDimension.PaleocraftDimension)));

    also change
    thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0);

    to
    thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, new TeleporterPaleocraft(thePlayer.mcServer.worldServerForDimension(0)));
    Posted in: Modification Development
  • 2

    posted a message on Help with adding crafting recipe using Charcol? (Simple?)
    for the charcoal block use
    new ItemStack(Item.coal, 1, 1)

    instead of Item.coal
    Posted in: Modification Development
  • 0

    posted a message on ItemStacks in Shapeless Recipes?

    ITEMSTACKS IN SHAPELESS RECIPES?

    nope

    unless you somehow recreate crafting
    Posted in: Modification Development
  • 0

    posted a message on [Forge 1.7.10] Bleach Mod [SSP/LAN/SMP] Hollow Test Update Available!
    add senbonzakura and kidou
    Posted in: WIP Mods
  • 1

    posted a message on Potion Mod
    Quote from WaterMinecraft

    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
      }
    }
    }
    Posted in: Modification Development
  • 0

    posted a message on Nuetral Mob Help
    try looking at the EntityPigZombie class
    Posted in: Modification Development
  • 0

    posted a message on Labeling a Custom Creative Tab?
    LanguageRegistry.instance().addStringLocalization("itemGroup.Extended Ores Armor", "Extended Ores Armor");

    put it in the @Init method
    Posted in: Modification Development
  • 0

    posted a message on How to make armor have infinite durability?
    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.
    Posted in: Modification Development
  • 0

    posted a message on Help with holding Item
    Quote from Jimmy04creeper

    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
    public ItemStack onItemRightClick(ItemStack par1, World par2, EntityPlayer par3)
    {
    if(par3 instanceof EntityPlayer)
    {
    EntityPlayer tempPlayer = (EntityPlayer)par3;
    if(tempPlayer.inventory.hasItem(this.itemID) == true && tempPlayer.capabilities.allowFlying != true)
    {
    tempPlayer.capabilities.allowFlying = true;
    }
    else if(tempPlayer.inventory.hasItem(this.itemID) == true && tempPlayer.capabilities.allowFlying != false)
    {
    tempPlayer.capabilities.allowFlying = false;
    }
    }
    return par1;
    }

    Although this will work, there is a bunch of unneeded things.
    First of all,
    if(par3 instanceof EntityPlayer)
    EntityPlayer tempPlayer = (EntityPlayer)par3;

    this is unneeded because of this
    public ItemStack onItemRightClick(ItemStack par1, World par2, EntityPlayer par3)

    par3 is already an instance of EntityPlayer
    also this,
    if(tempPlayer.inventory.hasItem(this.itemID) == true && tempPlayer.capabilities.allowFlying != true)

    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
    Posted in: Modification Development
  • 0

    posted a message on Help with holding Item
    use this
    Quote from russjr08

    The onItemUse method passes a EntityPlayer object that you should be able to use
    Posted in: Modification Development
  • 1

    posted a message on [2/3] Nearest Opaque Block w/ Air Above It (Spawning a flower when the player dies)
    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);
      }
    }
    Posted in: Modification Development
  • 0

    posted a message on Finding the coordinates of the player's spawn [SOLVED]
    Quote from WaterMinecraft

    Yeah that's true. Have you checked the bed class?

    ok I just did and I found the solution
    first I looked in the onBlockActivated method and I find this statement
    EnumStatus enumstatus = par5EntityPlayer.sleepInBedAt(par2, par3, par4);

    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
    return this.spawnChunk;

    and I use
    ((EntityPlayer) par1Entity).getBedLocation().posX
    ((EntityPlayer) par1Entity).getBedLocation().posY
    ((EntityPlayer) par1Entity).getBedLocation().posZ
    Posted in: Modification Development
  • 0

    posted a message on Finding the coordinates of the player's spawn [SOLVED]
    Quote from Chewy2014

    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
    Posted in: Modification Development
  • To post a comment, please .