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)
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)
Entschuldigung war mein Fehler ich habe einen Code 2 mal eingefügt beim Item
chris26
ich habe mal den Mod weiter geschrieben es fehlen noch die Boss Leben anzeige und das Biome
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?
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
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)
{
}
}
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;
}
}
}
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;
}
}
Code:
Die Namen der Texturen sind:
Beere1
Beere2
Beere3
Beere4
Beere5
Beere6
Beere7
Beere8
BeereSeeds
BeereFrucht
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.
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?
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
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
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