I was thinking that it might be good for you to add the mob spawner to the generation tutorial, so that other people could also get it to work, the code I used looked like this:
world.setBlockWithNotify(i +3, j, k +1, Block.mobSpawner.blockID);
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)world.getBlockTileEntity(i +3, j, k +1);
if (tileentitymobspawner != null)
{
tileentitymobspawner.setMobID(pickMobSpawner(random));
}
else
{
System.err.println((new StringBuilder()).append("Failed to fetch mob spawner entity at (").append(i).append(", ").append(j).append(", ").append(k).append(")").toString());
}
//end of test
return true;
}
return false;
}
//test
private String pickMobSpawner(Random random)
{
int i = random.nextInt(4);
if (i == 0)
{
return "Skeleton";
}
if (i == 1)
{
return "Zombie";
}
if (i == 2)
{
return "Pig";
}
if (i == 3)
{
return "Spider";
}
else
{
return "";
}
}
//end
}
And that will work, but only if the area around the mob spawner fulfills the conditions for the mob to spawn, the importent things to note are: the (i, j, k) positions for the block and tileentity have to be the same, the last chunk of code goes after the "return false line", and if you want only one mob to spawn you just have to change all the 'return "Nameheres"' to the same mob. I just thought that you might like to add that to your tutorial on structure generation. Now I think I will try to get chests to work
I was thinking that it might be good for you to add the mob spawner to the generation tutorial, so that other people could also get it to work, the code I used looked like this:
world.setBlockWithNotify(i +3, j, k +1, Block.mobSpawner.blockID);
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)world.getBlockTileEntity(i +3, j, k +1);
if (tileentitymobspawner != null)
{
tileentitymobspawner.setMobID(pickMobSpawner(random));
}
else
{
System.err.println((new StringBuilder()).append("Failed to fetch mob spawner entity at (").append(i).append(", ").append(j).append(", ").append(k).append(")").toString());
}
//end of test
return true;
}
return false;
}
//test
private String pickMobSpawner(Random random)
{
int i = random.nextInt(4);
if (i == 0)
{
return "Skeleton";
}
if (i == 1)
{
return "Zombie";
}
if (i == 2)
{
return "Pig";
}
if (i == 3)
{
return "Spider";
}
else
{
return "";
}
}
//end
}
And that will work, but only if the area around the mob spawner fulfills the conditions for the mob to spawn, the importent things to note are: the (i, j, k) positions for the block and tileentity have to be the same, the last chunk of code goes after the "return false line", and if you want only one mob to spawn you just have to change all the 'return "Nameheres"' to the same mob. I just thought that you might like to add that to your tutorial on structure generation. Now I think I will try to get chests to work
Thanks I might add that later. I'm sure you could probably figure it out yourself, but strength has a tutorial on generating chests with contents. It looks like it will work. You'll just need to fix the GenerateSurface method to suit 1.2 ModLoader.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Thanks I might add that later. I'm sure you could probably figure it out yourself, but strength has a tutorial on generating chests with contents. It looks like it will work. You'll just need to fix the GenerateSurface method to suit 1.2 ModLoader.
Oh, thanks, it will be much easier if I have something to start with, even if it is outdated.
Oh, and by the way, I think that the error I was getting before was because some of the "random"s were the wrong case (so they were caps when they were not suppose to)
Cannot make a static reference to the non-static field ItemAFruit.iconIndex
If you post your code and error report. then yes, someone could help you. Please realize that there is a multitude of different things that could have caused that, and from just that small snippet of the error, no one could tell you what was wrong (we could guess, but that is about it), were as if you post your code (and error report) other more experienced modders can look at it and actually see what the problem is, and therefor help you fix it.
It was sort of a guess but I used that tutorial ages ago and it took them like over an hour to explain stuff. I followed what they did, and it didn't even work, with 1.1 anyway.
lol yeah , i plan on making a better tutorial version of it later on since i finally got it to work ( 4hrs later )
now to just find a good block/item id extension tutorial =D
there is all the classes i have added to the game but i get an error when i start minecraft
firstly: to make the spoiler you need to put a "/" in the last [] so that you have [/spoile]
secondly: if the game crashes when you start minecraft it is most likely that your pictures are not linked properly, but it is hard to say if you don't post the error/crash report that you got.
i alredy knew i needed to use forge ... but i was wondering if it could be done with out it
and even with forge i cant figure it out .. can you teach me ? on how to use cordinates ??
i relay whant to use my own pgn
greets
I don't know how to do it without Forge, or even how to do it with Forge. I just know it has that feature. As I said on the last post, the other coder on the Undead+ team is trying to work this out.
i have another uestion. i gues using my own png is to far away becose it need forge .. thats realy sad... becose i dont whan tmy mod to ened modloader and forge .. to be used lol
anny way do you know about static ID's ??
for example sapling had ID 6 but there 3 kinds of saplings 6:0, 6:1, 6:2 ... that means it had the block ID 6 but an offset :0- :2 .. how can i do this ? with my blocks? becose i whant to add alot of block and MC ID's are limited not to mention other mods use ID's too
so i whant to give my blocks the offset like saplings do or stone slab 44:0 44:1 44:2
As you can see in that last line, f, f1 and f2 are all referenced too. If you change the values of those floats, then you can change the particle size. It may not be the giant thing that happens when the Ender Dragon dies, but this is the only thing I found in its class. You'll have to do some looking yourself.
Is there a way to remember the coordinates of where you teleported to an other dimension?
Example:
I make somewhere an portal of my dimension and land somewhere in the other dimension.
When I go back, I land where I entered the portal.
And now the difficult part (for me): When I build somewhere else an portal, I land at the first portal in the other Dimension.
But if I go back, I land againt at the portal, I started (this time the second)
Is this somehow possible??
PS: I use atm the Standard Portal-Code of the Nether
I don't know. Please go and ask in Mod Development. This isn't a help thread, it is a tutorials thread, and I am only helping people who are using my tutorials and are having trouble.
there is all the classes i have added to the game but i get an error when i start minecraft
Post the crash report please.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey is it possible to make it so that you there is an easy way to test your biome?
When doing mine, I just set its ID to 1, so that it overwrites plains. It seems to make it a lot easier to find. Don't forgot to change the ID back though when you're done testing!
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
here is the crash report for my error (6 posts up)
Mods loaded: 1
ModLoader 1.2.4
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 2f72aab9 --------
Generated 30/03/12 5:16 PM
Minecraft: Minecraft 1.2.4
OS: Windows XP (x86) version 5.1
Java: 1.7.0_03, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon Xpress 1150 x86/MMX/3DNow!/SSE2 version 2.0.6388 WinXP Release, ATI Technologies Inc.
java.lang.ExceptionInInitializerError
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:286)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1278)
at net.minecraft.src.ModLoader.init(ModLoader.java:848)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:156)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:422)
at net.minecraft.client.Minecraft.run(Minecraft.java:783)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.Block.<init>(Block.java:242)
at net.minecraft.src.mod_gallifrey.<clinit>(mod_gallifrey.java:7)
... 15 more
--- END ERROR REPORT aa40f8dc ----------
here is the crash report for my error (6 posts up)
Mods loaded: 1
ModLoader 1.2.4
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 2f72aab9 --------
Generated 30/03/12 5:16 PM
Minecraft: Minecraft 1.2.4
OS: Windows XP (x86) version 5.1
Java: 1.7.0_03, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon Xpress 1150 x86/MMX/3DNow!/SSE2 version 2.0.6388 WinXP Release, ATI Technologies Inc.
java.lang.ExceptionInInitializerError
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:286)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1278)
at net.minecraft.src.ModLoader.init(ModLoader.java:848)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:156)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:422)
at net.minecraft.client.Minecraft.run(Minecraft.java:783)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.Block.<init>(Block.java:242)
at net.minecraft.src.mod_gallifrey.<clinit>(mod_gallifrey.java:7)
... 15 more
--- END ERROR REPORT aa40f8dc ----------
Try changing the null to a 0 in your public static final line.
I have written the same code for the Achievements but I get this error.
java.lang.ExceptionInInitializerError
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:286)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1278)
at net.minecraft.src.ModLoader.init(ModLoader.java:848)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:156)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:422)
at net.minecraft.client.Minecraft.run(Minecraft.java:783)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.ItemStack.<init>(ItemStack.java:33)
at net.minecraft.src.ItemStack.<init>(ItemStack.java:28)
at net.minecraft.src.Achievement.<init>(Achievement.java:51)
at net.minecraft.src.mod_SilverMod.<clinit>(mod_SilverMod.java:10)
... 15 more
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hi im new with modding and i need some help: when i install modloader for 1.2.4 and then decompile i always get errors that make no sense. i can decompile with no modloader. i always use a brand new mcp folder and minecraft (bin) folder. i do all the change directory -> MCP, bash cleanup.sh and that stuff, but i always get errors. can you help me fix this? by the way im using a mac
package net.minecraft.src;
public class mod_afruit extends BaseMod
{
public static final Item afruit = new Item(161).setItemName("Fossilsed Fruit");
public void load()
{
ItemAFruit.shiftedIndex = ModLoader.addOverride("/gui/items.png", "/mods/fruit.png");
ModLoader.addName(afruit, "Fossilised Fruit");
ModLoader.addRecipe(new ItemStack(afruit, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.4";
}
}
Error report
--- BEGIN ERROR REPORT 40995615 --------
Generated 30-03-12 06:29 PM
Minecraft: Minecraft 1.2.4
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_31, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce GT 520M/PCI/SSE2 version 4.2.0, NVIDIA Corporation
java.lang.Error: Unresolved compilation problem:
Cannot make a static reference to the non-static field ItemAFruit.shiftedIndex
at net.minecraft.src.mod_afruit.load(mod_afruit.java:9)
at net.minecraft.src.ModLoader.init(ModLoader.java:855)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:156)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:422)
at net.minecraft.client.Minecraft.run(Minecraft.java:783)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT cedb4355 ----------
Thanks I might add that later. I'm sure you could probably figure it out yourself, but strength has a tutorial on generating chests with contents. It looks like it will work. You'll just need to fix the GenerateSurface method to suit 1.2 ModLoader.
together they are powerful beyond imagination."
Oh, thanks, it will be much easier if I have something to start with, even if it is outdated.
Oh, and by the way, I think that the error I was getting before was because some of the "random"s were the wrong case (so they were caps when they were not suppose to)
seem to be doing nothing, I dont understand
I would say that is is because you have "RedSTONE" not "redstone" in this chunk of code:
Cannot make a static reference to the non-static field ItemAFruit.iconIndex
If you post your code and error report. then yes, someone could help you. Please realize that there is a multitude of different things that could have caused that, and from just that small snippet of the error, no one could tell you what was wrong (we could guess, but that is about it), were as if you post your code (and error report) other more experienced modders can look at it and actually see what the problem is, and therefor help you fix it.
Oh, sorry Um, I think that you need to add ".blockID"
to this line:
so that it looks like this:
If that doesn't work (it should, but in case it doesn't) try this:
lol yeah , i plan on making a better tutorial version of it later on since i finally got it to work ( 4hrs later )
now to just find a good block/item id extension tutorial =D
i had that problem before , eclipse had a couple of solutions but the one that worked is change iconIndex to shiftedIndex
firstly: to make the spoiler you need to put a "/" in the last [] so that you have [/spoile]
secondly: if the game crashes when you start minecraft it is most likely that your pictures are not linked properly, but it is hard to say if you don't post the error/crash report that you got.
I don't know how to do it without Forge, or even how to do it with Forge. I just know it has that feature. As I said on the last post, the other coder on the Undead+ team is trying to work this out.
It is on the list to do (Damage-Value Blocks)
You need to learn Java, at least a bit of it.
As you can see in that last line, f, f1 and f2 are all referenced too. If you change the values of those floats, then you can change the particle size. It may not be the giant thing that happens when the Ender Dragon dies, but this is the only thing I found in its class. You'll have to do some looking yourself.
I don't know. Please go and ask in Mod Development. This isn't a help thread, it is a tutorials thread, and I am only helping people who are using my tutorials and are having trouble.
Then there is a problem with ModLoader. I can't do anything about it.
Post your code.
Post the crash report please.
together they are powerful beyond imagination."
When doing mine, I just set its ID to 1, so that it overwrites plains. It seems to make it a lot easier to find. Don't forgot to change the ID back though when you're done testing!
together they are powerful beyond imagination."
Try changing the null to a 0 in your public static final line.
Post your code anyway please.
together they are powerful beyond imagination."
Error report