I pretty much follow this example from the wiki, just altered the names.
Chestblock.js
// Gets the block id from the config file
id = config.getBlockId("ChestBlockID");
name = "ChestBlock";
// metadata 0.
displayName[0] = "Chest Storage Block";
material = "wood";
hardness[0] = 3.0;
idDropped[0] = config.getBlockId("ChestBlockID");
quantityDropped[0] = 1;
addToCreative[0] = true;
creativeTab = "buildingBlocks";
textureFile = "chestblock.png";
textureIndexXP[0] = 0;
textureIndexXN[0] = 0;
textureIndexYP[0] = 0;
textureIndexYN[0] = 0;
textureIndexZP[0] = 0;
textureIndexZN[0] = 0;
mod.js
// Adds a property to the config file.
config.addBlockIdProperty("ChestBlockID", 3000);
// Gets the block's id form the config file.
var ChestBlockID = config.getBlockId("ChestBlockID");
// Add the block components. chestblock.js' is the file and 'normal' is the type.
mod.addBlock("chestblock.js", "normal");
It says the idDropped isn't defined, but as I've said I follow the simple block exampled, just changed the names around.
The problem was with the example. The idDropped and quantityDropped attributes do not exist in CS2, but the example had them anyways. I have corrected the simple block example if you want to look there. The only change I made was from switching this:
The Meaning of Life, the Universe, and Everything.
Location:
Colorado Springs, CO
Join Date:
8/19/2012
Posts:
56
Minecraft:
Flaeme <3
Member Details
:V I was gonna use CS for some recipies, but now 1.4.6 came along, and RP2 came out for it, so I'm using 1.4.6 already. I really hope you update quick!
hello everyone! i wanted to know if this mod is going to be ported to bukkit before january 1st so i will be able to unveil my server in open beta. also has the getconfigid("blockID"); working for world gen yet? i couldnt get it working last time i was working with this mod and that was 1.4.2 :3
hello everyone! i wanted to know if this mod is going to be ported to bukkit before january 1st so i will be able to unveil my server in open beta. also has the getconfigid("blockID"); working for world gen yet? i couldnt get it working last time i was working with this mod and that was 1.4.2 :3
About bukkit: CubeX2 has never done a bukkit port, so it is very unlikely that he will start now. If you want a bukkit port, I would suggest finding one of the people who have worked on the bukkit ports before or have worked with the current bukkit versions. Also, since CS2 is now 1.4.6, it seems even more unlikely that a bukkit port of CS2 any time soon, as there is not even a mcpc bukkit for 1.4.6 yet.
About the config.getBlockId("string"); and config.getItemId("string"); values: As far as I can tell, there was never a problem with the functions in world gen files. I can confirm, regardless of previous state, that the functions should work perfectly considering they were used in the world gen files for Alvoria's Splendid Stones mod without problems. I am still not sure what the problem in your case was, but I noticed (didn't notice before) that you included the type attribute in your block files. This attribute does not exist in CS2, and may be causing some problems.
If you still have problems with your mod after adding the function back, then maybe you should consider uploading the full mod zip file this time. That way we can go through it with a fine tooth comb to find exactly what is wrong.
Can some1 help me with the following?
I'm using Custom Stuff 2 Beta 0.9.1 and having minecraft 1.3.2. There were no problems with installation, but with the coding...
I'll post here 2 examples of my stuff and I asking you to tell me why it don't want to work. It simply don't want to appear ingame. Also I tried to compare my code with code from *ExampleMod*. That one works fine and mine - no.
Mod.js code:
config.addBlockIdProperty("SilverOreID", 200);
var SilverOreID = config.getBlockId("SilverOreID");
mod.addBlock("SilverOre.js", "normal");
mod.addItem("SilverIngot.js", "normal");
Can some1 help me with the following?
I'm using Custom Stuff 2 Beta 0.9.1 and having minecraft 1.3.2. There were no problems with installation, but with the coding...
I'll post here 2 examples of my stuff and I asking you to tell me why it don't want to work. It simply don't want to appear ingame. Also I tried to compare my code with code from *ExampleMod*. That one works fine and mine - no.
Mod.js code:
config.addBlockIdProperty("SilverOreID", 200);
var SilverOreID = config.getBlockId("SilverOreID");
mod.addBlock("SilverOre.js", "normal");
mod.addItem("SilverIngot.js", "normal");
I am not seeing anything at the moment that looks wrong. Look in your ForgeModLoader-client-0.log file to see if there are any errors there. If there is an error, please post it to maybe help use find the problem. The older versions like the one you are using just removes the items from game if there was an error instead of causing a crash to point out the error. I think 0.9.3 is also for minecraft 1.3.2, so consider switching to that version if possible, as it fixes some bugs and may make errors easier to notice.
I don't know what just happened =)) But after I checked your post, cleared all Forge logs and entered the game after that - all worked fine =))
Anyways thank you =)
Previous questions are not important anymore.
But I have a new one =)
harvestlevel dont want to work. I've set it to *2*, set material *rock*, but I still can mine blocks with every pickaxe.
Previous questions are not important anymore.
But I have a new one =)
harvestlevel dont want to work. I've set it to *2*, set material *rock*, but I still can mine blocks with every pickaxe.
This hasn't been re-implemented in CS2 just yet. Please be patient with CubeX2 until it has been.
No big deal. Check the help file linked to on the front page for a comprehensive list of what's been added to CS2. Unfortunately, the Wiki will remain out of date for the time being as I'm still too busy with other stuff to update it, and nobody else seems to be stepping up.
CubeX2 has said many, many times that he has no experience with Bukkit and doesn't intend to start now. He's given permission to other people to port his mods in the past, however, so you have a better chance of approaching someone who does ports and see if they'll take the project on.
Is it possible to make blocks that deal damage a mob/player stands on it?
Unfortunately, the onWalking trigger does not use living or player, so this might be difficult to do directly. One thing that would be possible, would be to change the space above the block into a fire block whenever your custom block is walked on.
@CubeX2 - Could you add support for player and living to onWalking? Either the extra functions for checking if it is living or player or the onWalkingLiving and onWalkingPlayer versions would be great. Also, does the onWalking trigger every tick while something is walking on it or based on tickrate?
Does that mean you can also create custom Buildcraft pipes with this mod? Or does that only mean you can create blocks using materials from those mods? Or does that mean it just doesn't conflict and that's it?
The problem was with the example. The idDropped and quantityDropped attributes do not exist in CS2, but the example had them anyways. I have corrected the simple block example if you want to look there. The only change I made was from switching this:
to this:
After you fix that, it should work just fine. If you still have problems, we will be happy to try to help you.
Unfortunately, it did not. The same error still persists.
It fixed it for me. Thank you!
About bukkit: CubeX2 has never done a bukkit port, so it is very unlikely that he will start now. If you want a bukkit port, I would suggest finding one of the people who have worked on the bukkit ports before or have worked with the current bukkit versions. Also, since CS2 is now 1.4.6, it seems even more unlikely that a bukkit port of CS2 any time soon, as there is not even a mcpc bukkit for 1.4.6 yet.
About the config.getBlockId("string"); and config.getItemId("string"); values: As far as I can tell, there was never a problem with the functions in world gen files. I can confirm, regardless of previous state, that the functions should work perfectly considering they were used in the world gen files for Alvoria's Splendid Stones mod without problems. I am still not sure what the problem in your case was, but I noticed (didn't notice before) that you included the type attribute in your block files. This attribute does not exist in CS2, and may be causing some problems.
If you still have problems with your mod after adding the function back, then maybe you should consider uploading the full mod zip file this time. That way we can go through it with a fine tooth comb to find exactly what is wrong.
I'm using Custom Stuff 2 Beta 0.9.1 and having minecraft 1.3.2. There were no problems with installation, but with the coding...
I'll post here 2 examples of my stuff and I asking you to tell me why it don't want to work. It simply don't want to appear ingame. Also I tried to compare my code with code from *ExampleMod*. That one works fine and mine - no.
Mod.js code:
SilverOre.js code:
SilverIngot.js code:
I am not seeing anything at the moment that looks wrong. Look in your ForgeModLoader-client-0.log file to see if there are any errors there. If there is an error, please post it to maybe help use find the problem. The older versions like the one you are using just removes the items from game if there was an error instead of causing a crash to point out the error. I think 0.9.3 is also for minecraft 1.3.2, so consider switching to that version if possible, as it fixes some bugs and may make errors easier to notice.
Anyways thank you =)
But I have a new one =)
harvestlevel dont want to work. I've set it to *2*, set material *rock*, but I still can mine blocks with every pickaxe.
(Yea, I know. I'm waiting for it too. <_<)
CubeX2 has said many, many times that he has no experience with Bukkit and doesn't intend to start now. He's given permission to other people to port his mods in the past, however, so you have a better chance of approaching someone who does ports and see if they'll take the project on.
This game is so oreing.
Unfortunately, the onWalking trigger does not use living or player, so this might be difficult to do directly. One thing that would be possible, would be to change the space above the block into a fire block whenever your custom block is walked on.
@CubeX2 - Could you add support for player and living to onWalking? Either the extra functions for checking if it is living or player or the onWalkingLiving and onWalkingPlayer versions would be great. Also, does the onWalking trigger every tick while something is walking on it or based on tickrate?