[Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
4 posters
Page 1 of 1
[Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Blocks: Basic functions
Blockname -must have- Type#1.1
Block Dropping Type#1.2
Block Dropping Quantity Type#1.2
Hardness -must have- Type#1.1
LightOpacity Type#1.1
LightValue Type#1.1
Material -must have- Type#1.3
Resistance Type#1.1
StepSound -must have or not, i'm not sure- Type#1.1
Slipperiness Type#1.2
That's as much as I can find(the easy ones), if you need any others, feel free to post them here.
It's time for advance functions, it's gonna be really long, be careful when you open the spoiler, your eyes may burn
Blockname -must have- Type#1.1
- Spoiler:
Set the name for modding, NOT the one that appears when you point your mouse over the block in your inventory- Code:
.setBlockName("anyname")
Block Dropping Type#1.2
- Spoiler:
Set what the block drops when it's broken- Code:
public int idDropped(int i, Random random)
{
return *;
}
* can be Block.blocknameinsideblock.java example Block.blockGold (search for it inside Block.java)
* can be Item.itemnameinsideitem.java.shiftedIndex exaple Item.hoeGold.shiftedIndex (search for it in Item.java)
Block Dropping Quantity Type#1.2
- Spoiler:
How many of a thing the block'll drop- Code:
public int quantityDropped(Random random)
{
return *;
}
Hardness -must have- Type#1.1
- Spoiler:
This set how tough the block is, or how long it would take players to break it- Code:
.setHardness(*F)
LightOpacity Type#1.1
- Spoiler:
This sets the block's transparency, not the light that the block emits- Code:
.setLightOpacity(*)
Specialties
This is connected to isOpaqueCube(true or false) if this is false then LightOpacity will work(perhaps, any1 tested?)
LightValue Type#1.1
- Spoiler:
Now this sets the amount of light that a block emits- Code:
.setLightValue(*F)
Material -must have- Type#1.3
- Spoiler:
Set the block's material type, will be further spoken- Code:
Material.*
- Code:
air //transparent, can walk through, cant be touched, considered nothing
ground //doesnt burn, can be mined with anything, even bare hands
wood //same as ground but can be set on fire
rock //like ground but if you mine by hands, nothing'll drop, need wood tools at least
iron //like rock but needs stone tools
water //liquid, can walk through, boats can go on, can be seen, slow down movement
lava //like water
leaves // can burn
plants
sponge
cloth //can burn
fire //transparent
sand
circuits //special type of material, logic type material
glass
tnt //can burn
field_4262_q //dont care about this, i dont even know what it is yet :D, does any1 know?
ice
snow //another logic type material, it's said so
builtSnow
cactus
clay
pumpkin
portal
cakeMaterial
Resistance Type#1.1
- Spoiler:
This set the block's resistance to explosion- Code:
.setResistance(*F)
Special adjustments
-The real resistance is multiplied by 3, example, if u set .setResistance(5F), real resistance would be 15F
-The block's resistance is never smaller than 5 times same block's hardness, if you make it lower, the game will make them equal
Example:block hardness .setHardness(10F) and resistance .setResistance(3F) multiplied by 3 would be 9F smaller than 5 times hardness which is 50F then resistance would be set to 50F
StepSound -must have or not, i'm not sure- Type#1.1
- Spoiler:
Set the sound when you walk on each type of blocks- Code:
.setStepSound(sound*Footstep)
- Code:
Powder //redstone wires use this
Wood //wood blocks, chest, crafttable, pumpkin, fence, redstone things, sign, ladder, wood door, torch, fire(weird!?)
Gravel //gravel, clay
Grass //grass, sappling, leaves, sponge, flowers, mushrooms, TNT(wtf???), crops, reed
Stone //all kinds of stone things, ores, bedrock, brick, stair, furnace, button, jukebox, netherrack
Metal //steel,gold,diamond block, mobspawner, tracks, steel door
Glass //glass, ice, glowstone, portal
Cloth //wool, snow, cactus, cake
Sand //sand, slow sand
- Code:
soundPowderFootstep = new StepSound("stone", 1.0F, 1.0F);
soundWoodFootstep = new StepSound("wood", 1.0F, 1.0F);
soundGravelFootstep = new StepSound("gravel", 1.0F, 1.0F);
soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F);
soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
soundGlassFootstep = new StepSoundStone("stone", 1.0F, 1.0F);
soundClothFootstep = new StepSound("cloth", 1.0F, 1.0F);
soundSandFootstep = new StepSoundSand("sand", 1.0F, 1.0F);
Slipperiness Type#1.2
- Spoiler:
Sets the slipperiness of a block.- Code:
slipperiness = *F;
By default, slipperiness is 0,6F, that happens to all block that don't have different slipperiness set
That's as much as I can find(the easy ones), if you need any others, feel free to post them here.
It's time for advance functions, it's gonna be really long, be careful when you open the spoiler, your eyes may burn
Any1 care to find a proper word for my topic's title? because i think properties may not be appropriate for all of these codes, i'll change it to "function", tell me your opinion
Last edited by Will.Ez on Sat Apr 30, 2011 7:50 pm; edited 8 times in total (Reason for editing : Corrected Grammar, tutorials in this section NEED to be smart.)
Will.Ez- Iron Miner
- Posts : 52
Join date : 2011-04-22
Age : 27
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Blocks: Advanced functions
On things happen to block
Block Texture
On things happen to block
- Spoiler:
These can be easily understood by reading their names
Inside the brackets { and } are what will happen next- Code:
public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l)
{
}
- Code:
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
}
- Code:
public void onBlockAdded(World world, int i, int j, int k)
{
}
- Code:
public void onBlockRemoval(World world, int i, int j, int k)
{
}
- Code:
public void onBlockDestroyedByExplosion(World world, int i, int j, int k)
{
}
- Code:
public void onEntityWalking(World world, int i, int j, int k, Entity entity)
{
}
- Code:
public void onBlockPlaced(World world, int i, int j, int k, int l)
{
}
- Code:
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
{
}
- Code:
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
}
- Code:
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
}
Block Texture
- Spoiler:
- Code:
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
return getBlockTextureFromSideAndMetadata(l, iblockaccess.getBlockMetadata(i, j, k));
}
- Code:
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
- Code:
public int getBlockTextureFromSide(int i)
{
return blockIndexInTexture;
}
- Code:
public int colorMultiplier(IBlockAccess iblockaccess, int i, int j, int k)
{
return 0xffffff;
}
Last edited by Will.Ez on Sat Apr 30, 2011 7:48 pm; edited 6 times in total (Reason for editing : ok thanks Byronyello)
Will.Ez- Iron Miner
- Posts : 52
Join date : 2011-04-22
Age : 27
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Types
Block Functions
Type#1.1
Type#1.2
Type#1.3
Block Functions
Type#1.1
- Spoiler:
- This is the type of the properties that you put inside your Block.java or mod_Block.java if you use modloader
If you do NOT use modloader(poor you, try it) then inside Block.java, put it where the block is statically defined(this may be confusing)
Scroll down a bit until you find something like- Code:
static
{
soundPowderFootstep = new StepSound("stone", 1.0F, 1.0F);
soundWoodFootstep = new StepSound("wood", 1.0F, 1.0F);
soundGravelFootstep = new StepSound("gravel", 1.0F, 1.0F);
soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F);
soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
some look like this- Code:
dirt = (new BlockDirt(3, 2)).setHardness(0.5F).setStepSound(soundGravelFootstep).setBlockName("dirt");
then Type#1.1 properties would be something like the- Code:
.setHardness(0.5F)
.setStepSound(soundGravelFootstep)
.setBlockName("dirt")
If you use ModLoader then inside your mod_blablablamodnameblablabla.java (sorry too long name Razz)
The Type#1.1 properties would look something like this inside the whole block defining code- Code:
public static final Block Yourblockname = new BlockYourblockname(Yourblockid, 0).setHardness(0.3F).setBlockName("Nameabcabc");
- Code:
.setHardness(0.3F)
.setBlockName("Nameabcabc")
Type#1.2
- Spoiler:
- You put this property type inside your BlockYourblockname.java and between 2 brackets { and } of
- Code:
public class BlockDirt extends Block
{
protected BlockDirt(int i, int j)
{
[u]YOU SHOULD PUT THEM HERE [/u]
}
}
Type#1.3
- Spoiler:
- This is for material, you put them here
- Code:
public class BlockDirt extends Block
{
protected BlockDirt(int i, int j)
{
super(i, j, PUT THE PROPERTY HERE);
}
}
Last edited by Will.Ez on Wed Apr 27, 2011 1:14 am; edited 7 times in total
Will.Ez- Iron Miner
- Posts : 52
Join date : 2011-04-22
Age : 27
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Items: Basic functions
Last edited by Byronyello on Sat Apr 30, 2011 5:27 pm; edited 2 times in total (Reason for editing : Corrected Grammar, tutorials in this section NEED to be smart. :D)
Will.Ez- Iron Miner
- Posts : 52
Join date : 2011-04-22
Age : 27
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Items: Advanced functions
Last edited by Byronyello on Sat Apr 30, 2011 5:28 pm; edited 2 times in total (Reason for editing : Corrected Grammar, tutorials in this section NEED to be smart. :D)
Will.Ez- Iron Miner
- Posts : 52
Join date : 2011-04-22
Age : 27
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Thanks Byronyello for editing my post, they sure are a lot(a bit) easier to read
Last edited by Will.Ez on Sat Apr 30, 2011 7:40 pm; edited 1 time in total
Will.Ez- Iron Miner
- Posts : 52
Join date : 2011-04-22
Age : 27
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Thanks for these!
Some real content for once! (I hate placeholders )
Some real content for once! (I hate placeholders )
iCamasHD- Crafter
- Posts : 11
Join date : 2011-04-23
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Thank you for this EPIC list of block functions!
_1Greg1_- Gold Miner
- Posts : 82
Join date : 2011-04-26
Age : 27
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
How do I make a different block texture on each side of a block using modloader? using the override method just creates a block with the same texture on each side.
Coolio_G- Recruit
- Posts : 2
Join date : 2012-01-25
Re: [Beginner to Advanced] [List] List of blocks, items functions [updated 1/5/2011] [1.5_01] [2.12--]
Please move to the new forum, http://www.zidmc.info
_1Greg1_- Gold Miner
- Posts : 82
Join date : 2011-04-26
Age : 27
Similar topics
» [1.5_01] GlassCraft v.2.3 [UPDATED]
» [Unanswered]Depleting Items After Crafting [1.5_01][2.12]
» [UNANSWERED] Mobs Holding Items (MCP 2.12) (1.5_01)
» [1.5_01][SSP]Will.Ez's mod - Travel Blocks v1.0[1/5/11]
» [Beginner] Creating a new Recipe [22/4/11] [1.4_01] [2.11]
» [Unanswered]Depleting Items After Crafting [1.5_01][2.12]
» [UNANSWERED] Mobs Holding Items (MCP 2.12) (1.5_01)
» [1.5_01][SSP]Will.Ez's mod - Travel Blocks v1.0[1/5/11]
» [Beginner] Creating a new Recipe [22/4/11] [1.4_01] [2.11]
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|