I have a question. I don't know if this question is answered on the previous 255 pages. I want to make an Ingot. How should i texture it and code it in the my mod_ file?
This is my code:
-space saving snip-
The background of your texture is white. You have to change to transparent. Use a eraser.
Hello, I'm trying to change the name of the 'Flower' too 'Daffodil'. I have tried many different ways but all have failed. Does anyone have any suggestions?
Hello, I'm trying to change the name of the 'Flower' too 'Daffodil'. I have tried many different ways but all have failed. Does anyone have any suggestions?
You can actually do this without decompiling Minecraft. Go into the jar, open the lang folder, go into en_US.lang (or whatever locale you use) and look for the line 'tile.flower.name=Flower' and change 'Flower' to "Daffodil', then delete META-INF.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
i think the Item Tutorial needs to be updated because in 1.4.6 the update added 3d render in fancy graphics when you drop items
but with my custom items when i drop them in fancy the game crashes i dont know if there is a line of code or if you have to add a RenderYourItem.java
any help
Idk if this was mentioned, but the value for food saturation in the code is the actual saturation /2 /food points. I was confused at first because the values seemed so low, but it works like this for ex: golden carrot (137, 6, 0.6F, false)) 0.6 x 6 x 2 = actual saturation in game.
The Tool Tutorial works for 1.4.6 except some errors: (underline is red in eclipse)
1: In ItemNameHereHoe
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6))
2: In ItemNameHereTool
}
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return damageVsEntity;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
btw. If you want to enchant your custom items, use the anvil ^^
i think the Item Tutorial needs to be updated because in 1.4.6 the update added 3d render in fancy graphics when you drop items
but with my custom items when i drop them in fancy the game crashes i dont know if there is a line of code or if you have to add a RenderYourItem.java
any help
I'll gladly help if you can give me the error log. I've updated my mod to 1.4.6 and my items didn't require any changing to support 3d in-map rendering. It may require updating if you use a custom item renderer, otherwise, it should work; your item defaults to the global item renderer.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
I want to read the total time the player has been playing on a certain world from WorldInfo.getWorldTotalTime() and save it into a variable of type long BUT when I try to do it I get this error:
non-static method getWorldTotalTime() cannot be referenced from a static context
I partly understand why this happens, but I don't really know how else to do it - to be honest it has been a long time since I've worked with Java (or programming at all) so please excuse my lack of knowledge.
help would be appreciated
It means that you have to retrieve the specific WorldInfo Object you wish to retrieve the Total Time from. You can't retrieve it in a static context, as the method retrieves information from THAT specific instance of WorldInfo, which is not information which stays the same.
To do this, you would have to do something like this:
Be forewarned however, this is Client-Side only code, and will not work in a Server Context as the Minecraft.java does not exist in the Server-side files.
To do what you want to do on the Server-Side of things, you'll need something like this:
EntityPlayer player = ((EntityPlayer)MinecraftServer.getServer().getConfigurationManager().playerEntityList.get(Specific Player to Get));
long totalTime = player.worldObj.getWorldInfo().getWorldTotalTime();
(Again, be forewarned, this is not tested code and I do not know if it actually works. It is merely an example)
Ok, So I added 2 achievements, only one of them works
Can someone please fix this
//Awards the Player the booze achievement when they craft the Bottle of Wine item.
public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory)
{
if(itemstack.itemID == wine.shiftedIndex)
{
entityplayer.addStat(booze, 1);
}
}
Ok, So I added 2 achievements, only one of them works
Can someone please fix this
//Awards the Player the booze achievement when they craft the Bottle of Wine item.
public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory)
{
if(itemstack.itemID == wine.shiftedIndex)
{
entityplayer.addStat(booze, 1);
}
}
Ok, So I added 2 achievements, only one of them works
Can someone please fix this
//Awards the Player the booze achievement when they craft the Bottle of Wine item.
public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory)
{
if(itemstack.itemID == wine.shiftedIndex)
{
entityplayer.addStat(booze, 1);
}
}
The second one doesn't work, it's supposed to give the player the rubies achievement when they pickup a rubygem item. but it doesn't seem to work.
Make sure that all the parameters of onItemPickup are correct. If they're not then it won't work.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
ModLoader.addSmelting(Block.dirt.blockID, new ItemStack(Item.ingotGold, 1), 1.0F);
Smelting recipes are fairly simple, 'ModLoader.addSmelting' is the ModLoader method for smelting recipes. '(Block.dirt.blockID, new ItemStack(Item.goldIngot, 1));' just says that putting a block of dirt into the furnace and smelting it, will result into a new stack being created of gold ingots. One ingot being added to the new stack every time a dirt block is smelted. The float at the end(1.0F) is the amount of XP received from smelting the item. As a reference, cobblestone is 0.1F and a gold ingot is 1.0F
Ok so this is my code
ModLoader.addSmelting(mod_ores.sarliteore.blockID, new ItemStack(mod_ores.sarliteingot, 1), 100.0F);
Why 100? Well because it still adds just 1 of the little sections of the experience bar! Why does this happens?? Help!
I've also tryied lots of different values and it always gives me the same ammount of experience :c
Hey all, sorry if these questions have already been asked but I'm too lazy to look thru the thread...
1. How can I make a custom block (one that I made in a mod) flammable? So far it seems that all the flammable blocks are initialized in BlockFire.java:
But I get Exception In Initializer errors at those lines. Not sure what I'm doing wrong?
2. How can I make a custom potion effect? Right now I've created a new PotionRadiation.java (it's supposed to be a radiation damage effect):
public class PotionRadiation extends Potion
{
protected PotionRadiation(int par1, boolean par2, int par3) {
super(par1, par2, par3);
}
public void performEffect(EntityLiving par1EntityLiving, int par2)
{
par1EntityLiving.attackEntityFrom(DamageSource.magic, 1);
}
}
So this works mostly... when I'm affected potion particles appear around me and an icon appears next to my inventory. However, I'm not taking any damage from the potion, and that's the only thing that seems to not work.
Any help would be much appreciated! Thanks in advance
Hey all, sorry if these questions have already been asked but I'm too lazy to look thru the thread...
1. How can I make a custom block (one that I made in a mod) flammable? So far it seems that all the flammable blocks are initialized in BlockFire.java:
But I get Exception In Initializer errors at those lines. Not sure what I'm doing wrong?
What is the exception? I may be able to help you out.
Also delete "this." because your code should look like this:
public static final Block nameHere = new Block(160, 0, Material.rock).setBlockName("nameHere").setHardness(3.5F).setResistance(6.0F).setBurnRate(mod_Xenoscape.newLeaf.blockID, 30, 60);
What is the exception? I may be able to help you out.
Also delete "this." because your code should look like this:
public static final Block nameHere = new Block(160, 0, Material.rock).setBlockName("nameHere").setHardness(3.5F).setResistance(6.0F).setBurnRate(mod_Xenoscape.newLeaf.blockID, 30, 60);
This goes in your mod_*** file
Correct me if I'm wrong please.
Well actually I tried to add my two lines of code into BlockFire directly, not my mod_** file.. so the code would look like
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.minecraft.src.BlockFire.initializeBlock(BlockFire.java:43)
at net.minecraft.src.Block.(Block.java:1184)
at net.minecraft.src.TextureWaterFX.(TextureWaterFX.java:20)
at net.minecraft.client.Minecraft.(Minecraft.java:241)
at net.minecraft.src.MinecraftAppletImpl.(MinecraftAppletImpl.java:15)
at net.minecraft.client.MinecraftApplet.init(MinecraftApplet.java:25)
at net.minecraft.client.Minecraft.main(Minecraft.java:2156)
at Start.main(Start.java:22)
And also I tried your code and it says the method setBurnRate() doesn't exist in type Block, which is true because it only exists in BlockFire and not any other classes, eg it can only be called from within BlockFire
EDIT: I fixed it! Still, thanks for the help though.
In case anyone else is having this problem: I figured that the error was occurring because I'm trying to access the my custom blocks from mod_** before the mod was loaded... So I wrote a method in BlockFire..
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.minecraft.src.BlockFire.initializeBlock(BlockFire.java:43)
at net.minecraft.src.Block.(Block.java:1184)
at net.minecraft.src.TextureWaterFX.(TextureWaterFX.java:20)
at net.minecraft.client.Minecraft.(Minecraft.java:241)
at net.minecraft.src.MinecraftAppletImpl.(MinecraftAppletImpl.java:15)
at net.minecraft.client.MinecraftApplet.init(MinecraftApplet.java:25)
at net.minecraft.client.Minecraft.main(Minecraft.java:2156)
at Start.main(Start.java:22)
And also I tried your code and it says the method setBurnRate() doesn't exist in type Block, which is true because it only exists in BlockFire and not any other classes, eg it can only be called from within BlockFire
EDIT: I fixed it! Still, thanks for the help though.
In case anyone else is having this problem: I figured that the error was occurring because I'm trying to access the my custom blocks from mod_** before the mod was loaded... So I wrote a method in BlockFire..
The background of your texture is white. You have to change to transparent. Use a eraser.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffYou can actually do this without decompiling Minecraft. Go into the jar, open the lang folder, go into en_US.lang (or whatever locale you use) and look for the line 'tile.flower.name=Flower' and change 'Flower' to "Daffodil', then delete META-INF.
but with my custom items when i drop them in fancy the game crashes i dont know if there is a line of code or if you have to add a RenderYourItem.java
any help
Bored:
for(int i = 0; i < 1000; i++) {
System.out.println("I IS COOLS");
}
-
View User Profile
-
View Posts
-
Send Message
Curse Premium1: In ItemNameHereHoe
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6))
2: In ItemNameHereTool
}
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return damageVsEntity;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
btw. If you want to enchant your custom items, use the anvil ^^
edit: only works for the sword :/
-
View User Profile
-
View Posts
-
Send Message
Retired StaffI'll gladly help if you can give me the error log. I've updated my mod to 1.4.6 and my items didn't require any changing to support 3d in-map rendering. It may require updating if you use a custom item renderer, otherwise, it should work; your item defaults to the global item renderer.
Use Paint.net not Microsoft Paint }:-}
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIt means that you have to retrieve the specific WorldInfo Object you wish to retrieve the Total Time from. You can't retrieve it in a static context, as the method retrieves information from THAT specific instance of WorldInfo, which is not information which stays the same.
To do this, you would have to do something like this:
Be forewarned however, this is Client-Side only code, and will not work in a Server Context as the Minecraft.java does not exist in the Server-side files.
To do what you want to do on the Server-Side of things, you'll need something like this:
(Again, be forewarned, this is not tested code and I do not know if it actually works. It is merely an example)
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCan someone please fix this
//Awards the Player the booze achievement when they craft the Bottle of Wine item. public void takenFromCrafting(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory) { if(itemstack.itemID == wine.shiftedIndex) { entityplayer.addStat(booze, 1); } }public void onItemPickup(EntityPlayer entityplayer, ItemStack itemstack, IInventory iinventory ) { if(itemstack.itemID == rubygem.shiftedIndex) { entityplayer.addStat(rubies, 1); } }Please help!
The second one doesn't work, it's supposed to give the player the rubies achievement when they pickup a rubygem item. but it doesn't seem to work.
Nothing to see here, move along.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiummine looks like this:
static Achievement diamonds = AchievementList.diamonds; public static Achievement cobaltachiev = new Achievement(5000, "Holy Ore", -1, 3, mod_Cobalt.cobaltore, diamonds).registerAchievement(); public void load() { ModLoader.addAchievementDesc(cobaltachiev, "Holy Ore", "Find some CobaltOre and mine it");U have to add :
if(itemstack.itemID == mod_Cobalt.cobaltblock.blockID) { entityplayer.addStat(cobaltachiev1, 1); } if(itemstack.itemID == mod_Cobalt.cobaltapple.shiftedIndex) { entityplayer.addStat(cobaltachiev2, 1); }this after your public void load
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIt still doesn't work
Nothing to see here, move along.
Make sure that all the parameters of onItemPickup are correct. If they're not then it won't work.
together they are powerful beyond imagination."
Ok so this is my code
Why 100? Well because it still adds just 1 of the little sections of the experience bar! Why does this happens?? Help!
I've also tryied lots of different values and it always gives me the same ammount of experience :c
Visit my youtube channel?
http://www.youtube.com/user/TheCoolgatty
1. How can I make a custom block (one that I made in a mod) flammable? So far it seems that all the flammable blocks are initialized in BlockFire.java:
public void initializeBlock() { this.setBurnRate(Block.planks.blockID, 5, 20); this.setBurnRate(Block.woodDoubleSlab.blockID, 5, 20); this.setBurnRate(Block.woodSingleSlab.blockID, 5, 20); this.setBurnRate(Block.fence.blockID, 5, 20); this.setBurnRate(Block.stairCompactPlanks.blockID, 5, 20); this.setBurnRate(Block.stairsWoodBirch.blockID, 5, 20); this.setBurnRate(Block.stairsWoodSpruce.blockID, 5, 20); this.setBurnRate(Block.stairsWoodJungle.blockID, 5, 20); this.setBurnRate(Block.wood.blockID, 5, 5); this.setBurnRate(Block.leaves.blockID, 30, 60); this.setBurnRate(Block.bookShelf.blockID, 30, 20); this.setBurnRate(Block.tnt.blockID, 15, 100); this.setBurnRate(Block.tallGrass.blockID, 60, 100); this.setBurnRate(Block.cloth.blockID, 30, 60); this.setBurnRate(Block.vine.blockID, 15, 100); }so I try to add my own code:
But I get Exception In Initializer errors at those lines. Not sure what I'm doing wrong?
2. How can I make a custom potion effect? Right now I've created a new PotionRadiation.java (it's supposed to be a radiation damage effect):
public class PotionRadiation extends Potion { protected PotionRadiation(int par1, boolean par2, int par3) { super(par1, par2, par3); } public void performEffect(EntityLiving par1EntityLiving, int par2) { par1EntityLiving.attackEntityFrom(DamageSource.magic, 1); } }So this works mostly... when I'm affected potion particles appear around me and an icon appears next to my inventory. However, I'm not taking any damage from the potion, and that's the only thing that seems to not work.
Any help would be much appreciated! Thanks in advance
Jerry
What is the exception? I may be able to help you out.
Also delete "this." because your code should look like this:
public static final Block nameHere = new Block(160, 0, Material.rock).setBlockName("nameHere").setHardness(3.5F).setResistance(6.0F).setBurnRate(mod_Xenoscape.newLeaf.blockID, 30, 60);This goes in your mod_*** file
Correct me if I'm wrong please.
Visit my youtube channel?
http://www.youtube.com/user/TheCoolgatty
Well actually I tried to add my two lines of code into BlockFire directly, not my mod_** file.. so the code would look like
public void initializeBlock() { this.setBurnRate(Block.planks.blockID, 5, 20); this.setBurnRate(Block.woodDoubleSlab.blockID, 5, 20); this.setBurnRate(Block.woodSingleSlab.blockID, 5, 20); this.setBurnRate(Block.fence.blockID, 5, 20); this.setBurnRate(Block.stairCompactPlanks.blockID, 5, 20); this.setBurnRate(Block.stairsWoodBirch.blockID, 5, 20); this.setBurnRate(Block.stairsWoodSpruce.blockID, 5, 20); this.setBurnRate(Block.stairsWoodJungle.blockID, 5, 20); this.setBurnRate(Block.wood.blockID, 5, 5); this.setBurnRate(Block.leaves.blockID, 30, 60); this.setBurnRate(Block.bookShelf.blockID, 30, 20); this.setBurnRate(Block.tnt.blockID, 15, 100); this.setBurnRate(Block.tallGrass.blockID, 60, 100); this.setBurnRate(Block.cloth.blockID, 30, 60); this.setBurnRate(Block.vine.blockID, 15, 100); this.setBurnRate(mod_Xenoscape.newLog.blockID, 5, 5); this.setBurnRate(mod_Xenoscape.newLeaf.blockID, 30, 60); }And the error I get when I try to run this:
at net.minecraft.src.BlockFire.initializeBlock(BlockFire.java:43)
at net.minecraft.src.Block.(Block.java:1184)
at net.minecraft.src.TextureWaterFX.(TextureWaterFX.java:20)
at net.minecraft.client.Minecraft.(Minecraft.java:241)
at net.minecraft.src.MinecraftAppletImpl.(MinecraftAppletImpl.java:15)
at net.minecraft.client.MinecraftApplet.init(MinecraftApplet.java:25)
at net.minecraft.client.Minecraft.main(Minecraft.java:2156)
at Start.main(Start.java:22)
And also I tried your code and it says the method setBurnRate() doesn't exist in type Block, which is true because it only exists in BlockFire and not any other classes, eg it can only be called from within BlockFire
EDIT: I fixed it! Still, thanks for the help though.
In case anyone else is having this problem: I figured that the error was occurring because I'm trying to access the my custom blocks from mod_** before the mod was loaded... So I wrote a method in BlockFire..
protected Block setBurnRate() { this.setBurnRate(mod_Xenoscape.newLog.blockID, 5, 5); this.setBurnRate(mod_Xenoscape.newLeaf.blockID, 30, 60); return this; }and called it from my mod_**..
so it's made sure that the burn rates are set after the custom blocks have been declared.
Glad you could fix it!
Visit my youtube channel?
http://www.youtube.com/user/TheCoolgatty