LegendTriforce, how do I make my mob drop a custom item I made? Here's the code for the mod_ file for the item I made:
package net.minecraft.src;
public class mod_AcidItem extends BaseMod
{
public mod_AcidItem()
{
ModLoader.AddName(acidItem, "acid");
}
public static final Item acidItem;
static
{
acidItem = (new ItemAcid(4001)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/item/alienacid.png")).setItemName("acidAlien");
}
public String Version()
{
return "1";
}
}
How do I tell which item name is the correct one to put in the mob's drop code? I keep getting Cannot find symbol errors when I recompile.
First of all, that won't work because what you put in
.setItemName
has to be the same as the name you put in
public static final
! To make the mob drop your item you have to make it so that where it shows the item to be dropped you put
return (your mod file name:mod_AcidItem).(your item:acidItem).shiftedIndex
== MCP v4.1 ==
== Reobfuscating client ==
Traceback (most recent call last):
File "runtime\reobfuscate.py", line 42, in <module>
main(sys.argv[1])
File "runtime\reobfuscate.py", line 16, in main
commands.cleanreobfdir(0)
File "C:\Users\darren & marcus\Desktop\Modding\runtime\commands.py", line 509,
in cleanreobfdir
os.mkdir(outpathlk[side])
WindowsError: [Error 5] Access is denied: 'reobf/minecraft'
Press any key to continue . . .
Reobf error :sad.gif:
I would most likely reinstall mcp, then try recompiling and reobfuscating again. That should fix your problem. Either that or setting the permissions so the computer is allowed to access the folder.
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
[quote=miztakay;/comments/19281194]
I don't understand i'm doing everything right I'm trying to make a knight heres my source code for the Entity File : package net.minecraft.src;
public class EntityKnight extends EntityCreature
{
public EntityKnight(World world)
{
super(world);
//This is the texture for your mob
texture = "/mob/Knight.png";
}
protected int getDropItemId()
{
//This is the item your mob will drop
return Item.plateChain.shiftedIndex;
}
}
And here it is for the mod_knight file: package net.minecraft.src;
import java.lang.reflect.Method;
public class mod_Knight extends BaseMod
{
public mod_Knight()
{
}
public void AddEntityID()
{
//This defines your entity. Class name, entity name, and then the entity ID.
EntityList.addMapping(EntityKnight.class, "Knight", ModLoader.getUniqueEntityId());
//This adds your mob to the spawn list.
spawnlist.addCreaturesToSpawnList("Surface biomes", EntityKnight.class);
package net.minecraft.src;
public String Version()
{
//not sure exactly what this does, but I know that you can write pretty much anything you want in there.
return "mod_Knight version 1.1 [1.7.2]";
}
public mod_Knight()
{
ModLoader.RegisterEntityID(EntityKnight.class, "Knight", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(EntityKnight.class, 8, EnumCreatureType.creature);//not sure what the 8 does, play around with it if you want
}
//this part gives your mob a human model. This part is necessary if you want your mob to be able to carry stuff.
public void AddRenderer(Map map)
{
map.put(EntityKnight.class, new RenderBiped(new ModelBiped(), 0.5F));
}
}
}
}
Some one please help it shows me this when I try to recompile :
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Knight.java:17: illegal start of expression
package net.minecraft.src
^
src\minecraft\net\minecraft\src\mod_Knight.java:17: not a statement
package net.minecraft.src
^
src\minecraft\net\minecraft\src\mod_Knight.java:19: illegal start of expression
import java.lang.reflect.Method;
^
src\minecraft\net\minecraft\src\mod_Knight.java:19: not a statement
import java.lang.reflect.Method;
^
src\minecraft\net\minecraft\src\mod_Knight.java:20: illegal start of expression
import java.util.Map;
^
src\minecraft\net\minecraft\src\mod_Knight.java:20: not a statement
import java.util.Map;
^
src\minecraft\net\minecraft\src\mod_Knight.java:22: illegal start of expression
public class mod_Knight extends BaseMod
^
7 errors
===================
and then it says it can't fin the client bin when i reobfuscate it :sad.gif: sorry for such a long post but please someone help!!!!!!!!!!!!!
WHERE IS 303'S SPAWNER LIST? I searched like every comment in the previous tutorial, I searched the forums, I cant find it.. Is it like an API or just a list of the mobs to be spawned?
Wait, I think I found it... edit
Still cant figure out how to use it... I guess this tutorial is out of date?: http://mcp.ocean-lab...wnlist_mappings
It tells me to use files that arent there...
And the link the forum gives me are to a website that was shut down, so I am now frustrated. How am I supposed to get it?? Is there maybe a tutorial that isnt using it??
First of all, that won't work because what you put in has to be the same as the name you put in ! To make the mob drop your item you have to make it so that where it shows the item to be dropped you put !
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Yup, found it, it's in EntityMob!
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
I would most likely reinstall mcp, then try recompiling and reobfuscating again. That should fix your problem. Either that or setting the permissions so the computer is allowed to access the folder.
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
I don't understand i'm doing everything right I'm trying to make a knight heres my source code for the Entity File : package net.minecraft.src;
public class EntityKnight extends EntityCreature
{
public EntityKnight(World world)
{
super(world);
//This is the texture for your mob
texture = "/mob/Knight.png";
}
protected int getDropItemId()
{
//This is the item your mob will drop
return Item.plateChain.shiftedIndex;
}
}
And here it is for the mod_knight file: package net.minecraft.src;
import java.lang.reflect.Method;
public class mod_Knight extends BaseMod
{
public mod_Knight()
{
}
public void AddEntityID()
{
//This defines your entity. Class name, entity name, and then the entity ID.
EntityList.addMapping(EntityKnight.class, "Knight", ModLoader.getUniqueEntityId());
//This adds your mob to the spawn list.
spawnlist.addCreaturesToSpawnList("Surface biomes", EntityKnight.class);
package net.minecraft.src;
import java.lang.reflect.Method;
import java.util.Map;
public class mod_Knight extends BaseMod
{
public String Version()
{
//not sure exactly what this does, but I know that you can write pretty much anything you want in there.
return "mod_Knight version 1.1 [1.7.2]";
}
public mod_Knight()
{
ModLoader.RegisterEntityID(EntityKnight.class, "Knight", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(EntityKnight.class, 8, EnumCreatureType.creature);//not sure what the 8 does, play around with it if you want
}
//this part gives your mob a human model. This part is necessary if you want your mob to be able to carry stuff.
public void AddRenderer(Map map)
{
map.put(EntityKnight.class, new RenderBiped(new ModelBiped(), 0.5F));
}
}
}
}
Some one please help it shows me this when I try to recompile :
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Knight.java:17: illegal start of expression
package net.minecraft.src
^
src\minecraft\net\minecraft\src\mod_Knight.java:17: not a statement
package net.minecraft.src
^
src\minecraft\net\minecraft\src\mod_Knight.java:19: illegal start of expression
import java.lang.reflect.Method;
^
src\minecraft\net\minecraft\src\mod_Knight.java:19: not a statement
import java.lang.reflect.Method;
^
src\minecraft\net\minecraft\src\mod_Knight.java:20: illegal start of expression
import java.util.Map;
^
src\minecraft\net\minecraft\src\mod_Knight.java:20: not a statement
import java.util.Map;
^
src\minecraft\net\minecraft\src\mod_Knight.java:22: illegal start of expression
public class mod_Knight extends BaseMod
^
7 errors
===================
and then it says it can't fin the client bin when i reobfuscate it :sad.gif: sorry for such a long post but please someone help!!!!!!!!!!!!!
Reached end of file while parsing means that you either have an extra brace { or are missing one. That might also fix your other error.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Code:
LegendTriForce and StrongJoshua, got any ideas?
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Wait, I think I found it... edit
Still cant figure out how to use it... I guess this tutorial is out of date?:
http://mcp.ocean-lab...wnlist_mappings
It tells me to use files that arent there...
And the link the forum gives me are to a website that was shut down, so I am now frustrated. How am I supposed to get it?? Is there maybe a tutorial that isnt using it??