Ok, no time to format this, prepare your eyes.
Upon starting up my server, hosted on Avante with Multicraft, the console gets flooded with this message and refuses to startup, unresponsive to commands and only able to be stopped through multicraft's server.
25.09 17:41:33 [Server] INFO at net.minecraft.server.PropertyManager.savePropertiesFile(PropertyManager.java:76)
25.09 17:41:33 [Server] INFO at net.minecraft.server.PropertyManager.a(PropertyManager.java:65)
I'll post information on plugins, etc, if needed.
SOME BACKSTORY: I logged in today and found that I couldn't save a schematic, due to the server telling me "No space left on device" which I find strange, considering my server seems to have no harddrive limitations. Also, a few plugins went wonky. I restarted the server to see if I could clear some room, but instead of doing anything, it just made logblock and dynamap throw funky errors, which went away soon, but it reset nicknames, etc. No clue what's going on, avante won't answer me, clueless in wat.
Thanks in advance,
and rainbow dash is the best pony...
504Dug
TechGuy! Awsome news!!! I have figured out the code to a human mob! BUT I will give you the code if you tell me how to make so a NPC have a name above the head. Like the villagers had Testificate before. That is what I need. Tell me that and you will get the code.
Ya know, he's never going to do this. Just saying,
Getting this error when I test my code, no base classes have been changed or any errors:
Crash report
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Reecety\Documents\MCP\jars\.\crash-reports\crash-2012-08-16_08.41.20-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 53ad0b47 --------
Generated 8/16/12 8:41 AM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 997860768 bytes (951 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.1
mod_NomNom 1.3.1
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Character
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:162)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:482)
at net.minecraft.src.mod_NomNom.load(mod_NomNom.java:18)
at net.minecraft.src.ModLoader.init(ModLoader.java:927)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:161)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ea1fc2e6 ----------
Here is the mod_ file, if it'll help:
package net.minecraft.src;
public class mod_NomNom extends BaseMod
{
public static final Item Candy = new ItemFood(600, 2, 1F, false).setItemName("Candy");
public static final Item Wrapper = new ItemWrapper(601).setItemName("Wrapper");
public static final Item EggSoup = new ItemFood(602, 8, 3F, true).setItemName("EggSoup");
public static final Item Jar = new ItemJar(603).setItemName("Jar");
public static final Item ShroomSpread = new ItemFood(604, 2, 1F, true).setItemName("ShroomSpread");
public void load()
{
Candy.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/candy.png");
ModLoader.addName(Candy, "Candy");
ModLoader.addRecipe(new ItemStack(Candy, 3), new Object [] {"C", "W", Character.valueOf('C'), Item.dyePowder, 1, 3, Character.valueOf('C'), mod_NomNom.Wrapper.shiftedIndex});
Wrapper.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/wrapper.png");
ModLoader.addName(Wrapper, "Wrapper");
ModLoader.addRecipe(new ItemStack(Wrapper, 3), new Object [] {"P", Character.valueOf('P'), Item.paper});
EggSoup.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/eggsoup.png");
ModLoader.addName(EggSoup, "EggSoup");
ModLoader.addRecipe(new ItemStack(EggSoup, 1), new Object [] {"E", "B", Character.valueOf('E'), Item.egg, Character.valueOf('B'), Item.bowlEmpty});
Jar.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/jar.png");
ModLoader.addName(Jar, "Jar");
ModLoader.addRecipe(new ItemStack(Jar, 4), new Object [] {"P", Character.valueOf('P'), Block.glass});
ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png");
ModLoader.addName(ShroomSpread, "'shroom Spread");
ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomRed, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex});
ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png");
ModLoader.addName(ShroomSpread, "'shroom Spread");
ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomBrown, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex});
}
public String getVersion()
{
return "1.3.1";
}
}
Only thing I saw was this, and I'm not sure if it was causing it. Your code:
Hey, I'd like to know how you make blocks (specifically solid flower-like blocks) directional. By that, I mean like with a piston, how when you look above you and place that block, the block faces downwards. Another thing, I'd like to know how to make the item icon for previously mentioned block be the proper one, because as it stands, the texture in the inventory is a gray grass top. One more thing, I'd like to know how to make blocks hurt people upon being touched. Thanks in advance!
Hey super, a few things. I'll start with the note about contact.
There is a method to tell when an entity collides with the block:
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { <code> }
Implement that method in your BlockBlockName class and give the entity some damage. Best way to do damage is like this:
public void onEntityCollideWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
par5Entity.attackEntityFrom(new DamageSource("Block's Name"), x //x is the amount of damage dealt);
}
I would *highly* recommend to alter the bounding box to mimic a cactus if you want it to do damage on collision. Methods needed to do this: (it broke sorry, this just causes suffocation damage. Couldn't figure out how to legitimately make a bigger collisionbox.)
Right now I need to know how to add health or a timer to an item, make it tick, changing once every second, etc.
I'll see what I can do with trial and error, IF I COULD EVEN GET THE DAMNED BLOCK IN!!!!!
Seriously, for the entire time here I've been askign one thing.
How do I enter a simple
block into the game?
And you know what, NOT A SINGLE ANSWER ON HOW THIS IS DONE.
I mean, yeah, what the tutorial says is pretty basic, I even followed it all the way through, had someone check it after my fifth post of asking, and even that fixed coding didn't work.
All I need is a simple block implemented into the game. I can lear what I need, how I make it, and all that from the block's code, and from there, I'll enter in several more blocks on my own, but if I can't figure out how to get one fricken block in, how am I supposed to do that?
...maybe don't name the block the same as the class name? :s
Hm, I'd read the classes Block, BlockRedstoneTorch. I don't know about tickupdates but you'd have to change how it ticks...because currently it looks like every tick it checks whether or not it is powered and updates based on that. Sorry and best of luck, i'll keep looking into this
EDIT: Maybe, in BlockRedstoneTorch.checkForBurnout(...), before the return false statement, add a wait(time in ms to wait)
i did that and now i have a new error
src\minecraft\net\minecraft\src\BlockCrate.java:5: error: invalid method declaration; return required
public type required
public crate(int i, int j)
src\minecraft\net\minecraft\src\mod_Ninja.java:12: error: illegal start of type
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {" #" " #" "% " Char
acter.valueOf('#'), Item.ingotIron, Character.valueOf('%'), Item.stick});
^
src\minecraft\net\minecraft\src\mod_Ninja.java:16: error: class, interface, or e
num expected
public String getVersion()
^
src\minecraft\net\minecraft\src\mod_Ninja.java:19: error: class, interface, or e
num expected
}
^
Here is the recipe I am shooting for
Most of the errors are from the recipe but when I change to what it wants, more errors and it's not what your template looks like. a lot are also from the mod_Ninja file.
Here's my code.
mod_Ninja
package net.minecraft.src;
public class mod_Ninja extends BaseMod
{
public static final Item sword = new ItemKatana(2003, EnumToolMaterialIron.IRON).setItemName("Katana");
public void load()
{
sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/mods/Katana.png");
package net.minecraft.src;
public class ItemKatana extends Item
{
private int weaponDamage;
private final EnumToolMaterialIron toolMaterial;
public ItemKatana(int par1, EnumToolMaterialIron par2EnumToolMaterialIron)
{
super(par1);
toolMaterial = par2EnumToolMaterialIron;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialIron.getMaxUses());
weaponDamage = 6 + par2EnumToolMaterialIron.getDamageVsEntity();
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in foal classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.block;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 600;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
return par1ItemStack;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return toolMaterial.getEnchantability();
}
public String func_77825_f()
{
return this.toolMaterial.toString();
}
}
What do I put if I want the ToolMaterial to be iron? Thanks in advance.
thanks i changed it and now i have one error
src\minecraft\net\minecraft\src\blockcrate.java:11: error: ';' expected return mod_block.crate.160;
code
package net.minecraft.src;
public class mod_block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0,Material.wood).setBlockname("Crate").sethardnees(5f).setresistance(5f).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerBlock(crate);
ModLoader.addName(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
and my blockCrate class
package net.minecraft.src;
import java.util.Random;
public class crate extends Block
{
public crate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.crate.160;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Just have to warn you, be very careful with your code. I tried cleaning it up a bit, you had 2 different names for your BlockCrate class, a few misspellings, and some illegal arguments. I don't generally like to fix code entirely for people, but maybe you can see what's going on when it's working:
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0).setBlockName("Crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerBlock(crate);
ModLoader.addName(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
And this for your BlockCrate class:
package net.minecraft.src;
import java.util.Random;
public class BlockCrate extends Block
{
public crate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.crate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Hello, I made a ShineStone mod, which is stone that has a light value of 1.5, which is crafted by stone surrounding glowstone. The recipe works, the block works, but I haven't figured out how to make the name ShineStone appear in minecraft. help?
Btw, thx for the tutorials on modding with modloader, much more easier.
Add this line of code in the load() method:
ModLoader.addName(blockNameHere, "ShineStone");
Where "blockNameHere" is the name of the variable itself.
package net.minecraft.src;
public class mod_block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0,Material.wood).setBlockname(Crate).sethardnees(5f).setresistance(5f).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerblock(crate);
ModLoader.addname(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
First, check up on your coding itself: the block variable crate needs to be an instance of Block. Plus it's full of errors. Example code:
public static final Block crate = new Block(160,
0, Material.wood).setBlockName("crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
Next, check your method names, like ModLoader.addName <- you didn't capitalize the 'N' in addName; ModLoader.registerBlock; <- you didn't capitalize the B in registerBlock.
Hope this helps!
0
0
Upon starting up my server, hosted on Avante with Multicraft, the console gets flooded with this message and refuses to startup, unresponsive to commands and only able to be stopped through multicraft's server.
I'll post information on plugins, etc, if needed.
SOME BACKSTORY: I logged in today and found that I couldn't save a schematic, due to the server telling me "No space left on device" which I find strange, considering my server seems to have no harddrive limitations. Also, a few plugins went wonky. I restarted the server to see if I could clear some room, but instead of doing anything, it just made logblock and dynamap throw funky errors, which went away soon, but it reset nicknames, etc. No clue what's going on, avante won't answer me, clueless in wat.
Thanks in advance,
and rainbow dash is the best pony...
504Dug
0
1
Ya know, he's never going to do this. Just saying,
0
0
Only thing I saw was this, and I'm not sure if it was causing it. Your code:
0
0
Hey super, a few things. I'll start with the note about contact.
There is a method to tell when an entity collides with the block:
Implement that method in your BlockBlockName class and give the entity some damage. Best way to do damage is like this:
I would *highly* recommend to alter the bounding box to mimic a cactus if you want it to do damage on collision. Methods needed to do this: (it broke sorry, this just causes suffocation damage. Couldn't figure out how to legitimately make a bigger collisionbox.)
As far as the other two questions, can you post what code you have atm? I could take a look at it
0
...maybe don't name the block the same as the class name? :s
0
EDIT: Maybe, in BlockRedstoneTorch.checkForBurnout(...), before the return false statement, add a wait(time in ms to wait)
0
oops. my bad. Change the method name to this:
0
Repost code/question? :3
0
Try changing this line:
To this:
Not sure, but this should work.
Just have to warn you, be very careful with your code. I tried cleaning it up a bit, you had 2 different names for your BlockCrate class, a few misspellings, and some illegal arguments. I don't generally like to fix code entirely for people, but maybe you can see what's going on when it's working:
And this for your BlockCrate class:
0
Add this line of code in the load() method:
Where "blockNameHere" is the name of the variable itself.
0
First, check up on your coding itself: the block variable crate needs to be an instance of Block. Plus it's full of errors. Example code:
Next, check your method names, like ModLoader.addName <- you didn't capitalize the 'N' in addName; ModLoader.registerBlock; <- you didn't capitalize the B in registerBlock.
Hope this helps!