• 0

    posted a message on How to make a KillBlock in Minecraft 1.5.1 with modloader
    Quote from ElectricLink22

    First of all this should of been a video.
    Second of all i don't think this should be in the mod section.
    Third of all what if they just want the mod and don't want to do all of this

    Well I have been thinking of making this into a video, because it is a LOT to explain HAHA!! And if i do, i will post a link to it on here :)
    It is in the Mod section because it is a MOD as it is MODIFYING the game from its original state :)
    AND if you just wanted the MOD, then you can just copy and paste the CODE right out of the boxes and do it yourself :)
    Posted in: Mapping and Modding Tutorials
  • 3

    posted a message on How to make a KillBlock in Minecraft 1.5.1 with modloader
    How to Make KillBlock for Minecraft 1.5.1
    Ok First, you will need a few things.
    -Risugami's Modloader( at the time i made this, i was using Version 1.5.1)
    -Minecraft Coder Pac (MCP) ( at the time i made this, i was using Version 7.44)
    -(not needed, but helpful) Eclipse Juno
    Technically the only thing that you NEED to install this is Modloader(as i will provide a Dropbox link to the bin folder I have that has the mod already installed) But for all of you who would like to install it yourselves, like it to work with your other mods, or are having troubles with installing the bin folder, i will also provide the files that I made. There are 3 of them, and in order for them to work, you must name them exactly like this, and they are case sensitive.
    BlockAwesome
    ItemAwesome
    mod_MyMod
    The only way that the names of the files can be changed, is if you change the name in the files that declares it, and EVERY other reference to that file and name.


    I will now provide the code for these in the order of 1.BlockAwesome 2.ItemAwesome 3.mod_MyMod and then continue on with the tutorial:

    1. BlockAwesome

    package net.minecraft.src; 
    import java.util.Random;
    public class BlockAwesome extends Block{
    protected BlockAwesome(int par1) {
      super(par1, Material.rock);
      this.setTickRandomly(true);
      this.setCreativeTab(CreativeTabs.tabBlock);
    }
    
    public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
        {
    	    float var5 = 0.0625F;
    	    return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5));
        }
    
    public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
        {
    	    float var5 = 0.0625F;
    	    return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5));
        }
    
    public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
        {
    	    par5Entity.attackEntityFrom(DamageSource.cactus, 100);
        }
    
    
    public int idDropped(int par1, Random par2Random, int par3) {
      return mod_MyMod.awesomeBlock.blockID;
     
    }
    
    public int quantityDroppedWithBonus(int par1, Random par2Random) {
      return this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1);
    }
    
    
    }




    2. ItemAwesome

    package net.minecraft.src;
    public class ItemAwesome extends Item {
    protected ItemAwesome(int par1) {
      super(par1);
      setCreativeTab(CreativeTabs.tabMaterials);
    
    }
    }



    3. mod_MyMod

    package net.minecraft.src;
    import java.util.Random;
    public class mod_MyMod extends BaseMod {
    public static final Block awesomeBlock = (new BlockAwesome(169)).setHardness(5.0F).setResistance(2000.0F).setLightValue(1.0F).getIndirectPowerOutput("awesomeBlock");
    
    public static final Item awesomeItem = (new ItemAwesome(1690)).setUnlocalizedName("awesomeItem");
    
    @Override
    public String getVersion() {
    
      return "MyMod V1.0";
    }
    @Override
    public void load() {
      register();
      name();
      crafting();
      smelting();
     
    }
    
    public void register() {
      ModLoader.registerBlock(awesomeBlock);
    }
    
    public void name() {
      ModLoader.addName(awesomeBlock, "Awesome Block");
      ModLoader.addName(awesomeItem, "Awesome Item");
    }
    
    public void crafting() {
      ModLoader.addShapelessRecipe(new ItemStack(awesomeBlock,2), awesomeItem);
    }
    
    public void smelting () {
      ModLoader.addSmelting(awesomeItem.itemID,  new ItemStack(awesomeBlock,4), 1.0F);
    }
    
    
    public void generateSurface(World world, Random random, int i, int j){
       for(int r=0;r<200;r++){
        int x = 1 + random.nextInt(16);
        int y = random.nextInt(128);
        int z = 1 + random.nextInt(16);
        new WorldGenMinable(awesomeBlock.blockID,12).generate(world,  random,  x,  y,  z);
       }
    }
    
    public int addFuel(int i, int j){
      if(i == awesomeBlock.blockID){
       return 2000;
      }else{
       return 0;
      }
    }
     
     
    }







    Ok, lets' get started.
    Assuming you have already installed Modloader, Eclipse, and MCP, you must now Open up Eclipse. In the package explorer you need to expand Client, then src, then net.minecraft.src. Create your 3 new files by either copying and pasting the text into them, or just writing them yourself. Like I said the files need to be named as specified at the start of this tutorial.
    Once you have done this, you must exit out of Eclipse( not doing so will cause the decompiler to say something like - error occured permission denied) and now open up your MCP file ( It doesnt really matter what you have named this file, but it should be the file that has the files: .metadata, bin, conf, docs, eclipse, etc... And should also be where your Eclipse workspace is.) and click the recompile batch file. When that is done recompiling, then go back into MCP file and click on the reobsfucate batch ile and wait for that to finish. Now scroll up and open the reobsfucate FOLDER and in it should be a folder called minecraft, and in that should be ALL the files that you have modified.
    Ok now this is what I did, not sure if it will work any other way, as I have not tried, but if you did and it worked, then let me know :) I went and copied the minecraft.jar from MCP/jars/bin folder, and then went into my Users/appdata/Roaming/.minecraft/bin folder, and replaced the minecraft.jar in that folder, with the one from the MCP/jars/bin folder. ( Also im not sure if this matters, but in my .minecraft/bin folder, there is not multiple minecraft.jar files, Example some people will have minecraft-1.4.7.jar and a minecraft-1.5.jar but I do not, and it was causing errors when I would try to run my mod with the other ones also in there.)
    Then I took the 3 files that came out of the Reobsfucation folder, and copied them. Then I opened up the minecraft.jar file with winrar or whatever your using, and pasted all 3 files into it along with ALL the other class files. But I NEVER placed any of these files in the .minecraft/bin/mods folder, otherwise they will not work.
    Last step, is to take the texture that you wish to place on this block, and put it in the minecraft.jar/textures/block folder with the name awesomeBlock.png and do the same for the item, but instead name it awesomeItem.png and make sure that awesome is not capitalized, but Block and Item are.
    You should now be able to run minecraft and try it out, and if you get lost please either leave a comment, or even message me on here. AND if anyone knows whether or not it is safe to post a link to a copy of my bin file, let me know and i will post it immediately!! I just don't wanna post it if it has my account name/password or anything like that. Thanks! and enjoy :)
    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Risugami's Mods - Updated.
    ok so here is the code for my block, right now it is just very simple, but i want it to be able to hurt or cause damage, like how a cactus does when you touch it.
    package net.minecraft.src;
    public class mod_MyMod extends BaseMod {
    public static Block awesome = new Block(170, Material.wood).setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabDecorations).getIndirectPowerOutput("awesome");


    public String getVersion()
    {
    return "MyMod V1.0";
    }
    public void load()
    {
    ModLoader.registerBlock(awesome);
    ModLoader.addName(awesome, "Awesome");

    }

    }
    PLEASE HELP!!!! :)
    So far no one has been able to figure this one out, i guess it must just be too complicated for this website
    Posted in: Minecraft Mods
  • 0

    posted a message on Risugami's Mods - Updated.
    Quote from mrgreen33gamer

    Copy the block cactus and paste it in your block.

    I cant do that or else it creates a TON of errors and crashes when i try to run it.
    Posted in: Minecraft Mods
  • 0

    posted a message on Risugami's Mods - Updated.
    ok so here is the code for my block, right now it is just very simple, but i want it to be able to hurt or cause damage, like how a cactus does when you touch it.
    package net.minecraft.src;
    public class mod_MyMod extends BaseMod {
    public static Block awesome = new Block(170, Material.wood).setHardness(1.5F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabDecorations).getIndirectPowerOutput("awesome");
    
    
    public String getVersion()
    {
    return "MyMod V1.0";
    }
    public void load()
    {
      ModLoader.registerBlock(awesome);
      ModLoader.addName(awesome, "Awesome");
     
    }
    
    }

    PLEASE HELP!!!! :)
    Posted in: Minecraft Mods
  • 0

    posted a message on Risugami's Mods - Updated.
    ok so i made a block, and set the material to wood, and now i can ONLY mine it with an axe, i guess that is just normal. But i would also like to know how to set a damage value, and im sorry i was not clear last time haha i forget damage value can also be like the block hardness, but like for example Cactus. When you run into it, it hurts you, how do i do this to my block. I have now spent a total of 24 hours on this, all in one sitting, and STILL cannot figure it out. Thank you for your help :)
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.6.4][Forge][ModLoader] Mob Spawn Controls! Control Spawning! Increase SpawnCaps + Spawn Attempts! Mo'Creatures+ExtraBiomes S
    ok so i made a block, and set the material to wood, and now i can ONLY mine it with an axe, i guess that is just normal. But i would also like to know how to set a damage value, and im sorry i was not clear last time haha i forget damage value can also be like the block hardness, but like for example Cactus. When you run into it, it hurts you, how do i do this to my block. I have now spent a total of 24 hours on this, all in one sitting, and STILL cannot figure it out. Thank you for your help :)
    Posted in: Minecraft Mods
  • 0

    posted a message on Minecraft ModLoader 1.5.1 Tutorial
    ok so i made a block, and set the material to wood, and now i can ONLY mine it with an axe, i guess that is just normal. But i would also like to know how to set a damage value, and im sorry i was not clear last time haha i forget damage value can also be like the block hardness, but like for example Cactus. When you run into it, it hurts you, how do i do this to my block. I have now spent a total of 24 hours on this, all in one sitting, and STILL cannot figure it out. Thank you for your help :)
    Posted in: Tutorials
  • 0

    posted a message on Minecraft ModLoader 1.5.1 Tutorial
    Ok, im new to this, but how would i set a damage value to a block i created, and also how do i get it to be Mineable.
    Posted in: Tutorials
  • 0

    posted a message on Minecraft 1.5 Modloader Problems
    Ok so ALL of this is new to me, meaning im new to reading/writing code, and this is my first minecraft mod i have ever attempted, i also apologize if i am posting this in the wrong section but i just need someone to look at these files and tell me what they mean and how to fix them.
    So when i load regular Minecraft, it works ( meaning that it will load the game, but the block that I have attempted to create, is not in the creative inventory, i cannot craft it, and even when i type in the( /give player <block ID> )command, it still will not load the block. There are no errors in my code, (according to Eclipse), and it suggests that it should load just fine, but when i click "run client" in Eclipse, it will load the Mojang logo page, and then it crashes. this is the crash report that it gave me:
    ---- Minecraft Crash Report ----
    // I blame Dinnerbone.

    Time: 3/21/13 4:32 PM
    Description: Exception occured in ModLoader

    java.lang.IllegalArgumentException: Slot 200 is already occupied by [email protected] when adding [email protected]
    at net.minecraft.src.Block.<init>(Block.java:289)
    at net.minecraft.src.BlockMyblock.<init>(BlockMyblock.java:16)
    at net.minecraft.src.mod_Tutorialmod.<init>(mod_Tutorialmod.java:11)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at net.minecraft.src.ModLoader.addMod(ModLoader.java:366)
    at net.minecraft.src.ModLoader.readFromModFolder(ModLoader.java:1292)
    at net.minecraft.src.ModLoader.init(ModLoader.java:780)
    at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:180)
    at net.minecraft.src.RenderManager.<init>(RenderManager.java:96)
    at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:416)
    at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
    at net.minecraft.client.Minecraft.run(Minecraft.java:725)
    at java.lang.Thread.run(Unknown Source)


    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------

    -- System Details --
    Details:
    Minecraft Version: 1.5
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.7.0_17, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 969417400 bytes (924 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Suspicious classes: Start[net.minecraft.src.IPlayerUsage, ILogAgent, MinecraftFakeLauncher, ...]
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    ModLoader: Mods loaded: 1
    ModLoader 1.5





    This is the code for my mod:
    package net.minecraft.src;
    
    public class mod_Tutorialmod extends BaseMod {
        public static Block myblockBlock;
       
        public String Version() {
    	    return "1.6.6";
        }
    
        public mod_Tutorialmod() {
    	    myblockBlock = new BlockMyblock(200).setBlockName("Myblock Block"); //name for minecraft
    	    ModLoader.registerBlock(myblockBlock);
    	    ModLoader.addName(myblockBlock, "Myblock Block"); //name for ModLoader
    	   
    	    ModLoader.addRecipe(new ItemStack(myblockBlock,4), new Object[] {
    			    " ##"," @ ","++ ",
    			    Character.valueOf('#'),Block.planks,
    			    Character.valueOf('@'),Item.redstone,
    			    Character.valueOf('+'),Block.stone
    	    });
       
       
        }
    @Override
    public String getVersion() {
      // TODO Auto-generated method stub
      return null;
    }
    @Override
    public void load() {
      // TODO Auto-generated method stub
     
    }
    
    }


    And this is the code for the block I am attempting to create:
    package net.minecraft.src;
    import java.util.Random;
    public class BlockMyblock extends Block
    {
    private Icon field_94383_a;
        private Icon field_94381_b;
        private Icon field_94382_c;
    
      
      
        protected BlockMyblock(int par1)
    {
      super(par1, Material.ground);
      this.setCreativeTab(CreativeTabs.tabBlock);
      // TODO Auto-generated constructor stub
    }
    
    
        public Icon getBlockTextureFromSideAndMetadata(int par1, int par2)
        {
    	    return par1 == 1 ? this.field_94383_a : (par1 == 0 ? this.field_94381_b : (par2 > 0 && par1 == 4 ? this.field_94382_c : this.blockIcon));
        }
        public void registerIcons(IconRegister par1IconRegister)
        {
    	    this.blockIcon = par1IconRegister.registerIcon("myblock");
    	    this.field_94382_c = par1IconRegister.registerIcon("myblock");
    	    this.field_94383_a = par1IconRegister.registerIcon("myblock");
    	    this.field_94381_b = par1IconRegister.registerIcon("myblock");
        }
    
    public Block setBlockName(String string) {
      // TODO Auto-generated method stub
      return null;
    }
    
    }



    I don't care if the block has some crazy special function, or that it does anything special, i just want to be able to create my own block that has its own name and texture. The literal name want the block to be called in Minecraft, is Myblock. The method i used for saving the file as a mod (pretty sure it's not correct) is by making an archive with WinRar(as a .zip file) and named the archive mod_Tutorialmod.zip. Then in that i placed a copy of my mod file(mod_Tutorialmod), along with a copy of my block file(BlockMyblock). Then, along with the other two files i made a new file called "textures", then inside of that folder("textures"), I made another folder called "blocks" and inside of the blocks folder, i placed the 16x16 png file for the texture, and named it "myblock"
    If someone could please help with this, it would be GREATLY appreciated. I would just like to know how many errors i have made and how i can fix them or if this is still the correct way of making a block or not. Thank you =D
    Posted in: Java Edition Support
  • To post a comment, please .