Can you do a tutorial on making a mod multiplayer compatible? If not, can you point me to one.
EDIT: Also, if I wanted to say, just as an example. Make a silver coin out of 100 bronze coins. How would I do that?
EDIT2: Another tutorial that would be nice, would be GUI or something like a new inventory. Say I wanted to make an RPG with a specific inventory for money.
Can you do a tutorial on making a mod multiplayer compatible? If not, can you point me to one.
EDIT: Also, if I wanted to say, just as an example. Make a silver coin out of 100 bronze coins. How would I do that?
EDIT2: Another tutorial that would be nice, would be GUI or something like a new inventory. Say I wanted to make an RPG with a specific inventory for money.
ThyIce can you answer my questions by any chance? Any of them would be nice
Sorry I don't know how to mod for MP, I also don't know how you would make the silver coin out of 100 bronze... and for the GUI, well I am still learning... I just make my first Block with GUI Today. Agian sorry I could not help you .
Hi! I was trying to code a mob called Butler. However after getting it to start minecraft without errors, I realized that no Butlers were spawning... What am I doing wrong? Here is my code:
Mod_Butler.java
package net.minecraft.src;
import java.util.Map;
public class Mod_Butler extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(EntityButler.class, "The Butler", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityButler.class, 15, 5, 7, EnumCreatureType.monster);
}
public void addRenderer(Map map)
{
map.put(EntityButler.class, new RenderButler(new ModelButler(), 0.5F));
}
public String getVersion()
{
return "1.2.3";
}
}
EntityButler.java
package net.minecraft.src;
import java.util.Random;
public class EntityButler extends EntityMob
{
public EntityButler(World world)
{
super(world);
texture = "/image.png";
moveSpeed = 0.5F;
isImmuneToFire = false;
attackStrength = 6; //This line can only be here if the class extends EntityMob above ^^^. If it doesn't, just delete this whole line
}
public int getMaxHealth()
{
return 10;
}
protected String getLivingSound()
{
return "mob.villager.deafult";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
protected int getDropItemId()
{
return Item.plateChain.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
}
Eclipse told me I was missing a part in the RenderLiving.java file, so I added it using quickfix (Only the beginning where it was edited is shown here):
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderLiving extends Render
{
protected ModelBase mainModel;
/** The model to be used during the render passes. */
protected ModelBase renderPassModel;
public RenderLiving(ModelBase par1ModelBase, float par2)
{
mainModel = par1ModelBase;
shadowSize = par2;
}
public RenderLiving(ModelButler modelbutler, float f) {
}
/**
* Sets the model to be used in the current render pass (the first render pass is done after the primary model is
* rendered) Args: model
*/
public void setRenderPassModel(ModelBase par1ModelBase)
{
renderPassModel = par1ModelBase;
} ETC......
I got another crash with the mana ore, this time there's only 1 mod_ file. I tried to generate it but that didn't work
Here's the source code:
The mod_ManaOre.java
public class mod_ManaOre extends BaseMod
{
public static final Block ManaOre = new BlockManaOre(160, 0).setBlockName("Mana Ore").setHardness(7.5F).setResistance(15F).setLightValue(1F);
Item ManaCrystal = new ItemManaCrystal (5000).setItemName("Mana Crystal");
public void load()
{
ManaOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/MagikCraft/Mana Ore.png");
ManaCrystal.iconIndex = ModLoader.addOverride("/gui/items.png", "/MagikCraft/ManaCrystal.png");
ModLoader.registerBlock(ManaOre);
ModLoader.addName(ManaOre, "Mana Ore");
ModLoader.addName(ManaCrystal, "Mana Crystal");
World = ModLoader.getMinecraftInstance().theWorld;
}
private World World;
public void generateSurface (World World, Random random, int BaseX, int BaseZ)
{
for (int a= 0; a < 20; a++)
{
int Xcoord = BaseX + random.nextInt(16);
int Ycoord = random.nextInt(125);
int Zcoord = BaseX + random.nextInt(16);
(new WorldGenMinable(ManaOre.blockID, 8)).generate (World, random, Xcoord, Ycoord, Zcoord);
}
}
public String getVersion()
{
return "1.2.3";
}
}
The BlockManaOre.java
package net.minecraft.src;
import java.util.Random;
public class BlockManaOre extends Block
{
public BlockManaOre(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_ManaCrystal.ManaCrystal.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 3;
}}
The ItemManaCrystal.java
package net.minecraft.src;
public class ItemManaCrystal extends Item
{
public ItemManaCrystal(int i)
{
super(i);
maxStackSize = 64;
}
}
The Recompile crash:
== MCP 6.0 (data: 6.0, client: 1.2.3, server: 1.2.3) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_01\bin\javac" -g -source 1.6 -target 1.6 -class
path "lib;lib\*;jars\...' failed : 1
== ERRORS FOUND ==
warning: [options] bootstrap class path not set in conjunction with -source 1.6
src\minecraft\net\minecraft\src\mod_ManaOre.java:18: error: cannot find symbol
public void generateSurface (World World, Random random, int BaseX, int
BaseZ)
^
symbol: class Random
location: class mod_ManaOre
1 error
1 warning
==================
!! Can not find server sources, try decompiling !!
The method registerEntityID(Class<EntityNarwal>, String, int) is undefined
for the type ModLoader
and
Multiple markers at this line
- Line breakpoint:mod_Tuts [line: 12] - load()
- The method AddSpawn(Class, int, int, int, JsonNumberNode)
from the type ModLoader refers to the missing type JsonNumberNode
- The method addSpawn(Class<EntityNarwal>, int, int, int,
EnumCreatureType) is undefined for the type ModLoader
Can you do a tutorial on making a mod multiplayer compatible? If not, can you point me to one.
EDIT: Also, if I wanted to say, just as an example. Make a silver coin out of 100 bronze coins. How would I do that?
EDIT2: Another tutorial that would be nice, would be GUI or something like a new inventory. Say I wanted to make an RPG with a specific inventory for money.
I'm still working on a multiplayer mod myself at the moment, so I can't make a tutorial yet. This is the only tutorial I've come across for SMP.
I'm not sure how to do the silver coin thing, you would probably have to rewrite some of the crafting mechanics to do what you want to do.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
this is my superman code and i need to now to to make hime fly close to the groung i think it has to do with the motion y
package net.minecraft.src;
public class Entitysuperman extends EntityFlying implements IMob
{
public int courseChangeCooldown;
public double waypointX;
public double waypointY;
public double waypointZ;
private Entity targetedEntity;
/** Cooldown time between target loss and new target aquirement. */
private int aggroCooldown;
public int prevAttackCounter;
public int attackCounter;
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Would be very nice if you could make a tutorial on a mob spawning item (like spawn eggs)
Its fairly easy. All you have to do is go into entitylist.java, and add your mob into it. If you're not sure how to you can copy any creature with an egg and it'll work. If you want to change the colors of it go to the longer numbers at the end of it. If you don't know what I mean you can just PM me and I'll show you.
Also, Tech I was using your tutorial for the Biome Generation and the code I have is
mod_Trollium (The only part edited by the Biome Code)
/*Troll Biome Initalization*/
public static final BiomeGenBase TB = (new BiomeGenTB(26)).setColor(1635432).setBiomeName("Troll Biome");
/*----------------*/
public void load()
{
/*The Biome being added*/
ModLoader.addBiome(TB);
Now, it recompiles 100% fine. The error is ingame when you start a new world or continue to explore another. The error is
Mods loaded: 2
ModLoader 1.2.3
mod_Trollium 1.2.3
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT b9f4b3e2 --------
Generated 3/19/12 5:04 PM
Minecraft: Minecraft 1.2.3
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_30, Sun Microsystems Inc.
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 4200 version 2.1.8870, ATI Technologies Inc.
java.lang.ArrayIndexOutOfBoundsException: -128
at net.minecraft.src.ExtendedBlockStorage.func_48691_a(ExtendedBlockStorage.java:42)
at net.minecraft.src.Chunk.<init>(Chunk.java:115)
at net.minecraft.src.ChunkProviderGenerate.provideChunk(ChunkProviderGenerate.java:284)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:90)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:116)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:613)
at net.minecraft.src.World.getBlockId(World.java:529)
at net.minecraft.client.Minecraft.preloadWorld(Minecraft.java:2240)
at net.minecraft.client.Minecraft.changeWorld(Minecraft.java:2127)
at net.minecraft.client.Minecraft.changeWorld2(Minecraft.java:2074)
at net.minecraft.client.Minecraft.startWorld(Minecraft.java:1959)
at net.minecraft.src.GuiSelectWorld.selectWorld(GuiSelectWorld.java:199)
at net.minecraft.src.GuiWorldSlot.elementClicked(GuiWorldSlot.java:36)
at net.minecraft.src.GuiSlot.drawScreen(GuiSlot.java:216)
at net.minecraft.src.GuiSelectWorld.drawScreen(GuiSelectWorld.java:230)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:972)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:892)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 3db1217 ----------
Also, Tech I was using your tutorial for the Biome Generation and the code I have is
mod_Trollium (The only part edited by the Biome Code)
/*Troll Biome Initalization*/
public static final BiomeGenBase TB = (new BiomeGenTB(26)).setColor(1635432).setBiomeName("Troll Biome");
/*----------------*/
public void load()
{
/*The Biome being added*/
ModLoader.addBiome(TB);
Now, it recompiles 100% fine. The error is ingame when you start a new world or continue to explore another. The error is
Mods loaded: 2
ModLoader 1.2.3
mod_Trollium 1.2.3
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT b9f4b3e2 --------
Generated 3/19/12 5:04 PM
Minecraft: Minecraft 1.2.3
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_30, Sun Microsystems Inc.
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 4200 version 2.1.8870, ATI Technologies Inc.
java.lang.ArrayIndexOutOfBoundsException: -128
at net.minecraft.src.ExtendedBlockStorage.func_48691_a(ExtendedBlockStorage.java:42)
at net.minecraft.src.Chunk.<init>(Chunk.java:115)
at net.minecraft.src.ChunkProviderGenerate.provideChunk(ChunkProviderGenerate.java:284)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:90)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:116)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:613)
at net.minecraft.src.World.getBlockId(World.java:529)
at net.minecraft.client.Minecraft.preloadWorld(Minecraft.java:2240)
at net.minecraft.client.Minecraft.changeWorld(Minecraft.java:2127)
at net.minecraft.client.Minecraft.changeWorld2(Minecraft.java:2074)
at net.minecraft.client.Minecraft.startWorld(Minecraft.java:1959)
at net.minecraft.src.GuiSelectWorld.selectWorld(GuiSelectWorld.java:199)
at net.minecraft.src.GuiWorldSlot.elementClicked(GuiWorldSlot.java:36)
at net.minecraft.src.GuiSlot.drawScreen(GuiSlot.java:216)
at net.minecraft.src.GuiSelectWorld.drawScreen(GuiSelectWorld.java:230)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:972)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:892)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 3db1217 ----------
I think the issue here is being caused by the colour you have inputted. I think it needs to be divisible by 256, and have some other things too. Try adding a
package net.minecraft.src;
import java.util.Map;
public class mod_Tuts extends BaseMod
{
@Override
public void load()
{
ModLoader.RegisterEntityID(EntityNarwal.class, "Narwal",
ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityNarwal.class, 15, 5, 7, EnumCreatureType.waterCreature);
}
public void addRenderer(Map map)
{
map.put(EntityNarwal.class, new RenderNarwal(new ModelNarwal(), 0.5F));
}
@Override
public String getVersion()
{
return "1.2.3";
}
}
the problem is the addSpawn. it says:
The method addSpawn(Class<EntityNarwal>, int, int, int, EnumCreatureType) is undefined for the type ModLoader
please help, thank you.
P.S.
can u teach how to make it so you can saddle and ride it?
Make sure you have the latest ModLoader. I'm not making any tameable or ridable animal tutorials at the moment.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
To post a comment, please login or register a new account.
EDIT: Also, if I wanted to say, just as an example. Make a silver coin out of 100 bronze coins. How would I do that?
EDIT2: Another tutorial that would be nice, would be GUI or something like a new inventory. Say I wanted to make an RPG with a specific inventory for money.
If you want me to respond to you, reply to me with the "Quote" button under my post.
To make it drop your custom Item, you typ mod_*****.ITEMNAME.shiftedIndex
Example-
protected int getDropItemId()
{
return mod_Example.Pie.shiftedIndex;
}
I think it is possible... Try make your block a Decorator, then add this line to your biome "biomeDecorator.YOURBLOCKPerChunk = ANUMBER;"
Thanks!
If you want me to respond to you, reply to me with the "Quote" button under my post.
Sorry I don't know how to mod for MP, I also don't know how you would make the silver coin out of 100 bronze... and for the GUI, well I am still learning... I just make my first Block with GUI Today. Agian sorry I could not help you
Your Welcome
Thanks!
Your Welcome
LeonidasPL is correct. Look at his post.
Post your code please.
I'm still working on a multiplayer mod myself at the moment, so I can't make a tutorial yet. This is the only tutorial I've come across for SMP.
I'm not sure how to do the silver coin thing, you would probably have to rewrite some of the crafting mechanics to do what you want to do.
Have a look at WorldIntel's GUI tutorials. They're quite good. I partly learnt to make guis from him.
together they are powerful beyond imagination."
addBiome does not exist for me
package net.minecraft.src;
public class Entitysuperman extends EntityFlying implements IMob
{
public int courseChangeCooldown;
public double waypointX;
public double waypointY;
public double waypointZ;
private Entity targetedEntity;
/** Cooldown time between target loss and new target aquirement. */
private int aggroCooldown;
public int prevAttackCounter;
public int attackCounter;
public Entitysuperman(World par1World)
{
super(par1World);
courseChangeCooldown = 0;
texture = "/mob/superman.png";
setSize(1.0F, 1.8F);
moveSpeed = 0.15F;
experienceValue = 5;
isImmuneToFire = true;
}
protected void entityInit()
{
super.entityInit();
dataWatcher.addObject(16, Byte.valueOf((byte)0));
}
public int getMaxHealth()
{
return 10;
}
/**
* Called to update the entity's position/logic.
*/
protected void updateEntityActionState()
{
if (!worldObj.isRemote && worldObj.difficultySetting == 0)
{
setEntityDead();
}
despawnEntity();
prevAttackCounter = attackCounter;
double d = waypointX - posX;
double d1 = waypointY - posY;
double d2 = waypointZ - posZ;
double d3 = MathHelper.sqrt_double(d * d + d1 * d1 + d2 * d2);
if (d3 < 1.0D || d3 > 60D)
{
waypointX = posX + (double)((rand.nextFloat() * 2.0F - 1.0F) * 16F);
waypointY = posY + (double)((rand.nextFloat() * 2.0F - 1.0F) * 16F);
waypointZ = posZ + (double)((rand.nextFloat() * 2.0F - 1.0F) * 16F);
}
{
courseChangeCooldown += rand.nextInt(5) + 2;
if (isCourseTraversable(waypointX, waypointY, waypointZ, d3))
{
motionX += (d / d3) * 0.10000000000000001D;
motionY += (d1 / d3) * 0.1001D;
motionZ += (d2 / d3) * 0.10000000000000001D;
}
else
{
waypointX = posX;
waypointY = posY;
waypointZ = posZ;
renderYawOffset = rotationYaw = (-(float)Math.atan2(motionX, motionZ) * 180F) / (float)Math.PI;}}
}
/**
* True if the ghast has an unobstructed line of travel to the waypoint.
*/
private boolean isCourseTraversable(double par1, double par3, double par5, double par7)
{
double d = (waypointX - posX) / par7;
double d1 = (waypointY - posY) / par7;
double d2 = (waypointZ - posZ) / par7;
AxisAlignedBB axisalignedbb = boundingBox.copy();
for (int i = 1; (double)i < par7; i++)
{
axisalignedbb.offset(d, d1, d2);
if (worldObj.getCollidingBoundingBoxes(this, axisalignedbb).size() > 0)
{
return false;
}
}
return true;
}
/**
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound()
{
return "mob.villager.default";
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.zombiehurt";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.zombiedeath";
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return Item.ingotIron.shiftedIndex;
}
/**
* Drop 0-2 items of this living's type
*/
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 10F;
}
/**
* Will return how many at most can spawn in a chunk at once.
*/
public int getMaxSpawnedInChunk()
{
return 1;
}
}
Post your code.
Yeah, just try changing the motionY variable. I honestly have no clue about this one, I've only ever made land mobs.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse Premiummod_Trollium (The only part edited by the Biome Code)
/*Troll Biome Initalization*/ public static final BiomeGenBase TB = (new BiomeGenTB(26)).setColor(1635432).setBiomeName("Troll Biome"); /*----------------*/ public void load() { /*The Biome being added*/ ModLoader.addBiome(TB);BiomeGenTB
package net.minecraft.src; import java.util.List; import java.util.Random; public class BiomeGenTB extends BiomeGenBase { public BiomeGenTB(int par1) { super(par1); spawnableCreatureList.clear(); topBlock = (byte)mod_Trollium.Trollsand.blockID; fillerBlock = (byte)Block.sand.blockID; biomeDecorator.treesPerChunk = 1; biomeDecorator.flowersPerChunk = 0; biomeDecorator.grassPerChunk = 5; biomeDecorator.generateLakes = true; } }ModLoader 1.2.3
mod_Trollium 1.2.3
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT b9f4b3e2 --------
Generated 3/19/12 5:04 PM
Minecraft: Minecraft 1.2.3
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_30, Sun Microsystems Inc.
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 4200 version 2.1.8870, ATI Technologies Inc.
java.lang.ArrayIndexOutOfBoundsException: -128
at net.minecraft.src.ExtendedBlockStorage.func_48691_a(ExtendedBlockStorage.java:42)
at net.minecraft.src.Chunk.<init>(Chunk.java:115)
at net.minecraft.src.ChunkProviderGenerate.provideChunk(ChunkProviderGenerate.java:284)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:90)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:116)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:613)
at net.minecraft.src.World.getBlockId(World.java:529)
at net.minecraft.client.Minecraft.preloadWorld(Minecraft.java:2240)
at net.minecraft.client.Minecraft.changeWorld(Minecraft.java:2127)
at net.minecraft.client.Minecraft.changeWorld2(Minecraft.java:2074)
at net.minecraft.client.Minecraft.startWorld(Minecraft.java:1959)
at net.minecraft.src.GuiSelectWorld.selectWorld(GuiSelectWorld.java:199)
at net.minecraft.src.GuiWorldSlot.elementClicked(GuiWorldSlot.java:36)
at net.minecraft.src.GuiSlot.drawScreen(GuiSlot.java:216)
at net.minecraft.src.GuiSelectWorld.drawScreen(GuiSelectWorld.java:230)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:972)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:892)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 3db1217 ----------
mod_***(mod_Tuts)
package net.minecraft.src; import java.util.Map; public class mod_Tuts extends BaseMod { @Override public void load() { ModLoader.RegisterEntityID(EntityNarwal.class, "Narwal", ModLoader.getUniqueEntityId()); ModLoader.addSpawn(EntityNarwal.class, 15, 5, 7, EnumCreatureType.waterCreature); } public void addRenderer(Map map) { map.put(EntityNarwal.class, new RenderNarwal(new ModelNarwal(), 0.5F)); } @Override public String getVersion() { return "1.2.3"; } }the problem is the addSpawn. it says:
please help, thank you.
P.S.
can u teach how to make it so you can saddle and ride it?
It has been on my list to do. I just haven't had any time to make it.
I think the issue here is being caused by the colour you have inputted. I think it needs to be divisible by 256, and have some other things too. Try adding a
before the colour numbers
Make sure you have the latest ModLoader. I'm not making any tameable or ridable animal tutorials at the moment.
together they are powerful beyond imagination."