|
You last visited: Today at 10:39
Advertisement
Minecraft Mods erstellen [ModLoader]
Discussion on Minecraft Mods erstellen [ModLoader] within the Minecraft Guides & Strategies forum part of the Minecraft category.
|
View Poll Results: Ist diese Thema Hilfreich ?
|
|
Ja
|
  
|
247 |
89.17% |
|
Nein
|
  
|
30 |
10.83% |
04/10/2012, 20:36
|
#166
|
elite*gold: 0
Join Date: Apr 2012
Posts: 22
Received Thanks: 0
|
Hallo alle zusammen!
Ich modde schon seit ein paar Wochen und habe ein bisschen Ahnung, mein Problem ist nur ,dass das mit der Tür bei mir überhaupt nicht geht kann mir da jemand helfen.
(Ich modde 1.2.5)
|
|
|
04/10/2012, 21:51
|
#167
|
elite*gold: 0
Join Date: Feb 2011
Posts: 454
Received Thanks: 345
|
|
|
|
04/11/2012, 09:42
|
#168
|
elite*gold: 0
Join Date: Aug 2009
Posts: 56
Received Thanks: 2
|
sieht ja gut aus
|
|
|
04/11/2012, 11:46
|
#169
|
elite*gold: 0
Join Date: Jun 2011
Posts: 379
Received Thanks: 56
|
Du gibst dir hier viel Mühe.
Morgen bin ich wieder Zuhause, denn werde ich dir ein paar Datein schicken wo auch sowas wie die Animation erklärt wird.
|
|
|
04/11/2012, 12:47
|
#170
|
elite*gold: 0
Join Date: Apr 2012
Posts: 17
Received Thanks: 2
|
Gutes Tutorial! Eine Frage:
Ich will meine eigene Fackel erstellen. Hab ich auch geschafft, aber...
1. will ich, dass die Flamme grün ist und nicht gelb und...
2. Hat die Fackel nur eine Textur wenn sie platziert ist. Wenn ich sie zerstöre dann bekomme ich den Block 0!
Kann mir jdm helfen?
|
|
|
04/11/2012, 12:48
|
#171
|
elite*gold: 0
Join Date: Apr 2012
Posts: 22
Received Thanks: 0
|
Hallo nochmal!
Danke the_cake für die schnelle Antwort.
Jetzt funktioniert es auch.
Hab aber nochmal ne Frage kenn jemand zufällig ein Tutorial wo erklärt ist wie man seine eigene Pflanze macht? (die soll wie Getreide sein)
Für 1.2.5 natürlich
Danke schon mal
|
|
|
04/11/2012, 13:09
|
#172
|
elite*gold: 0
Join Date: Jun 2011
Posts: 379
Received Thanks: 56
|
Pflanzen müssten eig. so sein.
Mod datei:
Code:
package net.minecraft.src;
import java.util.Random;
public class mod_Beere extends BaseMod
{
public static final Item BeereSeeds = (new BeereSeeds(39, mod_Beere.BeereCrops.blockID, Block.tilledField.blockID)).setIconCoord(9, 0).setItemName("BeereSeeds");
public static Block BeereCrops = (new BlockCrops(247, 0)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setBlockName("BeereCrops").disableStats().setRequiresSelfNotify();
public static final Item BeereFrucht = (new ItemFood(2452, 2, 0.3F, false)).setItemName("BeereFrucht");
public static int Beere1;
public static int Beere2;
public static int Beere3;
public static int Beere4;
public static int Beere5;
public static int Beere6;
public static int Beere7;
public static int Beere8;
public String getVersion()
{
return "1.2.5";
}
public void load() { }
public mod_Beere()
{
ModLoader.registerBlock(BeereCrops);
ModLoader.addName(BeereSeeds, "Beere Seed");
Beere1 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere1.png");
Beere2 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere2.png");
Beere3 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere3.png");
Beere4 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere4.png");
Beere5 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere5.png");
Beere6 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere6.png");
Beere7 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere7.png");
Beere8 = ModLoader.addOverride("/terrain.png", "/Pflanze/Beere8.png");
BeereSeeds.iconIndex = ModLoader.addOverride("/gui/items.png", "/Pflanze/BeereSeeds");
BeereFrucht.iconIndex = ModLoader.addOverride("/gui/items.png", "/Pflanze/BeereFrucht");
}
public void GenerateSurface(World worldMod, Random rand, int i, int j)
{
}
}
Seed datei:
Code:
package net.minecraft.src;
public class BeereSeeds extends Item
{
/**
* The type of block this seed turns into (wheat or pumpkin stems for instance)
*/
private int blockType;
/** BlockID of the block the seeds can be planted on. */
private int soilBlockID;
public BeereSeeds(int par1, int par2, int par3)
{
super(par1);
blockType = par2;
soilBlockID = par3;
}
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS !
*/
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7)
{
if (par7 != 1)
{
return false;
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6) || !par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6))
{
return false;
}
int i = par3World.getBlockId(par4, par5, par6);
if (i == soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6))
{
par3World.setBlockWithNotify(par4, par5 + 1, par6, blockType);
par1ItemStack.stackSize--;
return true;
}
else
{
return false;
}
}
}
Pflanzen datei:
Code:
package net.minecraft.src;
import java.util.Random;
public class BeereCrops extends BlockFlower
{
protected BeereCrops(int par1, int par2)
{
super(par1, par2);
blockIndexInTexture = par2;
setTickRandomly(true);
float f = 0.5F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.tilledField.blockID;
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if (i < 7)
{
float f = getGrowthRate(par1World, par2, par3, par4);
if (par5Random.nextInt((int)(25F / f) + 1) == 0)
{
i++;
par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
}
}
}
}
/**
* Apply bonemeal to the crops.
*/
public void fertilize(World par1World, int par2, int par3, int par4)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 7);
}
/**
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
* this one). Args: x, y, z
*/
private float getGrowthRate(World par1World, int par2, int par3, int par4)
{
float f = 1.0F;
int i = par1World.getBlockId(par2, par3, par4 - 1);
int j = par1World.getBlockId(par2, par3, par4 + 1);
int k = par1World.getBlockId(par2 - 1, par3, par4);
int l = par1World.getBlockId(par2 + 1, par3, par4);
int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1);
int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1);
int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1);
int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1);
boolean flag = k == blockID || l == blockID;
boolean flag1 = i == blockID || j == blockID;
boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID;
for (int i2 = par2 - 1; i2 <= par2 + 1; i2++)
{
for (int j2 = par4 - 1; j2 <= par4 + 1; j2++)
{
int k2 = par1World.getBlockId(i2, par3 - 1, j2);
float f1 = 0.0F;
if (k2 == Block.tilledField.blockID)
{
f1 = 1.0F;
if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0)
{
f1 = 3F;
}
}
if (i2 != par2 || j2 != par4)
{
f1 /= 4F;
}
f += f1;
}
}
if (flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
if (par2 == 0)
{
return blockIndexInTexture;
}
if (par2 == 1)
{
return mod_Beere.Beere1;
}
if (par2 == 2)
{
return mod_Beere.Beere2;
}
if (par2 == 3)
{
return mod_Beere.Beere3;
}
if (par2 == 4)
{
return mod_Beere.Beere4;
}
if (par2 == 5)
{
return mod_Beere.Beere5;
}
if (par2 == 6)
{
return mod_Beere.Beere6;
}
if (par2 == 7)
{
return mod_Beere.Beere7;
}
if (par2 == 8)
{
return mod_Beere.Beere8;
}
return par2;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 6;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
if (par1World.isRemote)
{
return;
}
int i = 3 + par7;
for (int j = 0; j < i; j++)
{
if (par1World.rand.nextInt(15) <= par5)
{
float f = 0.7F;
float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_Beere.BeereSeeds));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
if (par1 == 7)
{
return mod_Beere.BeereFrucht.shiftedIndex;
}
else
{
return -1;
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 1;
}
}
Die Namen der Texturen sind:
Beere1
Beere2
Beere3
Beere4
Beere5
Beere6
Beere7
Beere8
BeereSeeds
BeereFrucht
sie kommen in den Ordner Pflanze
|
|
|
04/11/2012, 16:32
|
#173
|
elite*gold: 0
Join Date: Feb 2011
Posts: 454
Received Thanks: 345
|
Quote:
Originally Posted by idattnertv
Gutes Tutorial! Eine Frage:
Ich will meine eigene Fackel erstellen. Hab ich auch geschafft, aber...
1. will ich, dass die Flamme grün ist und nicht gelb und...
2. Hat die Fackel nur eine Textur wenn sie platziert ist. Wenn ich sie zerstöre dann bekomme ich den Block 0!
Kann mir jdm helfen?
|
Erst einmal danke
Code:
1. will ich, dass die Flamme grün ist und nicht gelb und...
Ich schau mal wie man die Ändern kann muss wahrscheinlich die Partikel Farbe des Feuers ändern
Code:
2. Hat die Fackel nur eine Textur wenn sie platziert ist. Wenn ich sie zerstöre dann bekomme ich den Block 0!
Zu dieser frage ich habe es auch einmal Versucht mit einer eignen Fackel allerdings konnte ich auch nicht das Icon ändern.
|
|
|
04/11/2012, 17:30
|
#174
|
elite*gold: 0
Join Date: Jun 2011
Posts: 379
Received Thanks: 56
|
Das Feuer der Fackel ist ein Effect.
|
|
|
04/11/2012, 22:13
|
#175
|
elite*gold: 0
Join Date: Feb 2011
Posts: 454
Received Thanks: 345
|
Echt ok wuste ich nicht
|
|
|
04/11/2012, 22:38
|
#176
|
elite*gold: 0
Join Date: Jun 2011
Posts: 379
Received Thanks: 56
|
EntityFlameFX sind die Feuer Particle der Fakel.
Um die Particle umzufärben schreib das in eine .java Datei:
Code:
package net.minecraft.src;
import java.util.Random;
public class EntityFlameGreenFX extends EntityFX
{
/** the scale of the flame FX */
private float flameScale;
public EntityFlameGreenFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
{
super(par1World, par2, par4, par6, par8, par10, par12);
motionX = motionX * 0.0099999997764825821D + par8;
motionY = motionY * 0.0099999997764825821D + par10;
motionZ = motionZ * 0.0099999997764825821D + par12;
par2 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
par4 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
par6 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
flameScale = particleScale;
particleRed = 0F;
particleGreen = 0F;
particleBlue = 1.0F;
particleMaxAge = (int)(8D / (Math.random() * 0.80000000000000004D + 0.20000000000000001D)) + 4;
noClip = true;
setParticleTextureIndex(48);
}
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
float f = ((float)particleAge + par2) / (float)particleMaxAge;
particleScale = flameScale * (1.0F - f * f * 0.5F);
super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
}
public int getBrightnessForRender(float par1)
{
float f = ((float)particleAge + par1) / (float)particleMaxAge;
if (f < 0.0F)
{
f = 0.0F;
}
if (f > 1.0F)
{
f = 1.0F;
}
int i = super.getBrightnessForRender(par1);
int j = i & 0xff;
int k = i >> 16 & 0xff;
j += (int)(f * 15F * 16F);
if (j > 240)
{
j = 240;
}
return j | k << 16;
}
/**
* Gets how bright this entity is.
*/
public float getBrightness(float par1)
{
float f = ((float)particleAge + par1) / (float)particleMaxAge;
if (f < 0.0F)
{
f = 0.0F;
}
if (f > 1.0F)
{
f = 1.0F;
}
float f1 = super.getBrightness(par1);
return f1 * f + (1.0F - f);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
if (particleAge++ >= particleMaxAge)
{
setDead();
}
moveEntity(motionX, motionY, motionZ);
motionX *= 0.95999997854232788D;
motionY *= 0.95999997854232788D;
motionZ *= 0.95999997854232788D;
if (onGround)
{
motionX *= 0.69999998807907104D;
motionZ *= 0.69999998807907104D;
}
}
}
und mit dem Code:
Code:
ModLoader.getMinecraftInstance().effectRenderer.addEffect(new EntityFlameGreenFX(world, d, d1, d2, d3, d4, d5));
in der jeweiligen Block datei werden die Neuen Particle gespawnt
|
|
|
04/12/2012, 15:37
|
#177
|
elite*gold: 0
Join Date: Apr 2012
Posts: 17
Received Thanks: 2
|
WOW! Danke!!!!
Eine Frage noch:
Ich will einen Block machen, der sich wie eine GlowstoneLampe verhält. Das ist ja die BlockRedstoneLight.java, oder?
Jetzt meine 2 Fragen:
1. Dort ist angegeben " public BlockRedstoneLight(int par1, boolean par2)"! Was muss ich als boolean eintragen? Das steht nicht mit drin!?
2. Die Lampe hat ja zwei Texturen! Also die Lampe an und die Lampe aus! Wie stelle ich diese ein?
|
|
|
04/12/2012, 16:18
|
#178
|
elite*gold: 0
Join Date: Feb 2011
Posts: 454
Received Thanks: 345
|
Quote:
Originally Posted by -i[Gyxx]*
EntityFlameFX sind die Feuer Particle der Fakel.
Um die Particle umzufärben schreib das in eine .java Datei:
Code:
package net.minecraft.src;
import java.util.Random;
public class EntityFlameGreenFX extends EntityFX
{
/** the scale of the flame FX */
private float flameScale;
public EntityFlameGreenFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
{
super(par1World, par2, par4, par6, par8, par10, par12);
motionX = motionX * 0.0099999997764825821D + par8;
motionY = motionY * 0.0099999997764825821D + par10;
motionZ = motionZ * 0.0099999997764825821D + par12;
par2 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
par4 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
par6 += (rand.nextFloat() - rand.nextFloat()) * 0.05F;
flameScale = particleScale;
particleRed = 0F;
particleGreen = 0F;
particleBlue = 1.0F;
particleMaxAge = (int)(8D / (Math.random() * 0.80000000000000004D + 0.20000000000000001D)) + 4;
noClip = true;
setParticleTextureIndex(48);
}
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
float f = ((float)particleAge + par2) / (float)particleMaxAge;
particleScale = flameScale * (1.0F - f * f * 0.5F);
super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
}
public int getBrightnessForRender(float par1)
{
float f = ((float)particleAge + par1) / (float)particleMaxAge;
if (f < 0.0F)
{
f = 0.0F;
}
if (f > 1.0F)
{
f = 1.0F;
}
int i = super.getBrightnessForRender(par1);
int j = i & 0xff;
int k = i >> 16 & 0xff;
j += (int)(f * 15F * 16F);
if (j > 240)
{
j = 240;
}
return j | k << 16;
}
/**
* Gets how bright this entity is.
*/
public float getBrightness(float par1)
{
float f = ((float)particleAge + par1) / (float)particleMaxAge;
if (f < 0.0F)
{
f = 0.0F;
}
if (f > 1.0F)
{
f = 1.0F;
}
float f1 = super.getBrightness(par1);
return f1 * f + (1.0F - f);
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
if (particleAge++ >= particleMaxAge)
{
setDead();
}
moveEntity(motionX, motionY, motionZ);
motionX *= 0.95999997854232788D;
motionY *= 0.95999997854232788D;
motionZ *= 0.95999997854232788D;
if (onGround)
{
motionX *= 0.69999998807907104D;
motionZ *= 0.69999998807907104D;
}
}
}
und mit dem Code:
Code:
ModLoader.getMinecraftInstance().effectRenderer.addEffect(new EntityFlameGreenFX(world, d, d1, d2, d3, d4, d5));
in der jeweiligen Block datei werden die Neuen Particle gespawnt
|
Du warst zu schnell xD
Quote:
Originally Posted by idattnertv
WOW! Danke!!!!
Eine Frage noch:
Ich will einen Block machen, der sich wie eine GlowstoneLampe verhält. Das ist ja die BlockRedstoneLight.java, oder?
Jetzt meine 2 Fragen:
1. Dort ist angegeben " public BlockRedstoneLight(int par1, boolean par2)"! Was muss ich als boolean eintragen? Das steht nicht mit drin!?
2. Die Lampe hat ja zwei Texturen! Also die Lampe an und die Lampe aus! Wie stelle ich diese ein?
|
Das muss ihn deine Block datei.
Code:
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if(world.isBlockIndirectlyGettingPowered(i, j, k))
{
world.setBlockWithNotify(i, j, k, mod_deinmodname.lampeAn.blockID);
} else
{
world.setBlockWithNotify(i, j, k, mod_deinmodname.lampeAus.blockID););
}
}
Da du hoffentlich schon weist das jeder Block eine andere Textur haben kann. Weis du einfach lampeAn eine Textur zu wenn sie an ist also heller und bei lampeAus wie halt dein block aus sieht wenn er dunkel ist. Du must natürlich beiden eine eigenes Licht geben geben
|
|
|
04/12/2012, 16:19
|
#179
|
elite*gold: 0
Join Date: Apr 2012
Posts: 17
Received Thanks: 2
|
Ich war mal wieder zu schnell 
Tut mir leid! Okay, VIELEN, VIELEN Dank!!!
Es klappt jetzt! Hab es zwar ein bisschen anders gemacht, aber es klappt! 
Das hier hat mir gefehlt...
Code:
mod_deinmodname.lampeAn.blockID
Ich hab doch tatsächlich vergessen, wie man auf andere Class Dateien zugreift
|
|
|
04/12/2012, 16:39
|
#180
|
elite*gold: 0
Join Date: Feb 2011
Posts: 454
Received Thanks: 345
|
Quote:
Originally Posted by idattnertv
Ich war mal wieder zu schnell  D
Tut mir leid! Okay, VIELEN, VIELEN Dank!!!
|
Das ist der Block text
Code:
package net.minecraft.src;
public class BlockNeonlight extends Block
{
protected BlockNeonlight(int par1, int par2)
{
super(par1, par2, Material.ground);
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if(world.isBlockIndirectlyGettingPowered(i, j, k))
{
world.setBlockWithNotify(i, j, k, mod_Name.neonlighton.blockID);
} else
{
world.setBlockWithNotify(i, j, k, mod_Name.neonlightoff.blockID);
}
}
}
|
|
|
Similar Threads
|
Minecraft Mods selber erstellen
10/26/2011 - Minecraft - 6 Replies
Vorab: Ich weiß folgende Frage wurde schon oft gestellt:
Wie mache ich eigene Mods? Hab keine Java Kentnisse.
Bei mir ist der Fall ähnlich ich habe im Internet gesucht und folgendes gefunden:
Minecraft Mod Maker - Minecraft Forum
Jedoch funktioniert der bei mir nicht :(
Meine Frage an euch gibt e einei alternative oder gibt es eine andere Möglichkeit? Es muss nichts großes sein. Ich möchte jedoch nur zb. einen
Block erstellen der kwinw besonderen Funktionen hat wie der Grassblock
|
All times are GMT +1. The time now is 10:42.
|
|