Jump to content

deantonious

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by deantonious

  1. Hi, I'm making a new mod based on experimenting the gravity with minecraft, I coded a new command that changes the EntityFallingSand gravity, but instead of that, I want to create my own Falling block as the sand but with different classes. Could anyone tell me how I register that entity (When I place that entity with my falling block it's invisible) Thanks
  2. What I want is to simulate the real life gravity for the science class Maybe If its easier, how could i do it editing the base classes?
  3. That's what I mean, how to change the acceleration of those entities.
  4. Hi, I'm trying to change the gravity aceleration in minecraft. I have been looking for the class were I could change it, but I dindn't find anything... If it's not posible to change all the gravity in minecraft, maybe it's posible to change it in just one block? Thanks
  5. Hi, I made my own block that gives you a random Item on right click, but there is a problem... The video shows the problem... http://deantonious.es/block.mp4 The Block code is this: package deantonious.blocks; import java.util.ArrayList; import java.util.Random; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import deantonious.ModPowderCraft; import net.minecraft.block.material.Material; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.src.ModLoader; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; public class BlockMenaSubsuelo extends Block { public BlockMenaSubsuelo(int id, Material material) { super(id, material); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if(par5EntityPlayer.getHeldItem() == null) { if(!par1World.isRemote){ par5EntityPlayer.addChatMessage("Necesitas un Cincel"); } return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); } if(par5EntityPlayer.getHeldItem().itemID == ModPowderCraft.cincel.itemID) { par5EntityPlayer.getHeldItem().stackSize -= 1; if(!par1World.isRemote) { int rand = par1World.rand.nextInt(60); if(rand<=8 && rand>=0){ par5EntityPlayer.addChatMessage("You obtained a Blue Sphere"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaazul)); } else if(rand<=16 && rand>={ par5EntityPlayer.addChatMessage("You obtained a Red Sphere"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaroja)); } else if(rand<=24 && rand>=16){ par5EntityPlayer.addChatMessage("You obtained a Green Sphere"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaverde)); } else if(rand<=32 && rand>=24){ par5EntityPlayer.addChatMessage("You obtained a Pale Sphere"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemablanca)); } else if(rand<=40 && rand>=32){ par5EntityPlayer.addChatMessage("You obtained a Prism Sphere"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaprisma)); } else if(rand<=42 && rand>=40){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.ArmorFossilCovered)); } else if(rand<=44 && rand>=42){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.ClawFossilCovered)); } else if(rand<=46 && rand>=44){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.CoverFossilCovered)); } else if(rand<=48 && rand>=46){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.DomeFossilCovered)); } else if(rand<=50 && rand>=48){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.HelixFossilCovered)); } else if(rand<=52 && rand>=50){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.OldAmberCovered)); } else if(rand<=54 && rand>=52){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.PlumeFossilCovered)); } else if(rand<=56 && rand>=54){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.RootFossilCovered)); } else if(rand<=58 && rand>=56){ par5EntityPlayer.addChatMessage("You obtained a Covered Fossil"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.SkullFossilCovered)); } else if(rand<=60 && rand>=58){ par5EntityPlayer.addChatMessage("You obtained a Bone"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bone)); } par1World.setBlock(par2, par3, par4, Block.dirt.blockID); } par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.break", 0.3F, 0.5F, blockConstructorCalled); par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.orb", 0.3F, 0.5F, blockConstructorCalled); return true; } return true; } } Thanks for the help
  6. When I change it to !isRemote, it gives me the item but its invisible... when I click on it all of them apear... adn also the block doesn't sets to dirt...
  7. Is there any way of spawning an Item in the block position?
  8. I want all of them to execute in both server and client. I don't really know what .isRemote is, but without it, it gives two items
  9. This is the actual code, please tell me what I need to change: package deantonious.blocks; import java.util.ArrayList; import java.util.Random; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import deantonious.ModPowderCraft; import net.minecraft.block.material.Material; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.src.ModLoader; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; public class BlockMenaSubsuelo extends Block { public BlockMenaSubsuelo(int id, Material material) { super(id, material); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if(par5EntityPlayer.getHeldItem() == null) { if(par1World.isRemote){ par5EntityPlayer.addChatMessage("Necesitas un Cincel"); } return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); } if(par5EntityPlayer.getHeldItem().itemID == ModPowderCraft.cincel.itemID) { par5EntityPlayer.getHeldItem().stackSize -= 1; //only if you want to use the item when you do this. if(par1World.isRemote) { par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.break", 0.3F, 0.5F, blockConstructorCalled); par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.orb", 0.3F, 0.5F, blockConstructorCalled); int rand = par1World.rand.nextInt(60); if(rand<=8 && rand>=0){ par5EntityPlayer.addChatMessage("Has encontrado una Gema Azul"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaazul)); } else if(rand<=16 && rand>={ par5EntityPlayer.addChatMessage("Has encontrado una Gema Roja"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaroja)); } else if(rand<=24 && rand>=16){ par5EntityPlayer.addChatMessage("Has encontrado una Gema Verde"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaverde)); } else if(rand<=32 && rand>=24){ par5EntityPlayer.addChatMessage("Has encontrado una Gema Blanca"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemablanca)); } else if(rand<=40 && rand>=32){ par5EntityPlayer.addChatMessage("Has encontrado una Gema Prisma"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaprisma)); } else if(rand<=42 && rand>=40){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.ArmorFossilCovered)); } else if(rand<=44 && rand>=42){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.ClawFossilCovered)); } else if(rand<=46 && rand>=44){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.CoverFossilCovered)); } else if(rand<=48 && rand>=46){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.DomeFossilCovered)); } else if(rand<=50 && rand>=48){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.HelixFossilCovered)); } else if(rand<=52 && rand>=50){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.OldAmberCovered)); } else if(rand<=54 && rand>=52){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.PlumeFossilCovered)); } else if(rand<=56 && rand>=54){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.RootFossilCovered)); } else if(rand<=58 && rand>=56){ par5EntityPlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.SkullFossilCovered)); } else if(rand<=60 && rand>=58){ par5EntityPlayer.addChatMessage("Has encontrado un Hueso"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bone)); } return true; } par1World.setBlock(par2, par3, par4, Block.dirt.blockID); return false; } return false; } }
  10. If I don't use the isRemote, It makes the action two times... (Without the isRemote the ploblem dosn't fix) It's just in survival mode... Remember you are right clicking on a block
  11. Everything works on single player, but when I play MP it gives the items, messages, etc. and then whe you try to take them, all the items disapear... But that only happens in survival mode, in creative mode it works...
  12. I tried the mod in my server and I found an error: It gives you the item, but only in Client Side... When I right click on the inventory, all the items that the mod gave me disapears... How I enable this to be in server side? package deantonious.blocks; import java.util.ArrayList; import java.util.Random; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.SideOnly; import deantonious.ModPowderCraft; import net.minecraft.block.material.Material; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; import net.minecraft.src.ModLoader; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; public class BlockMenaSubsuelo extends Block { public BlockMenaSubsuelo(int id, Material material) { super(id, material); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if(par5EntityPlayer.getHeldItem() == null) { if(par1World.isRemote){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Necesitas un Cincel"); } return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); } if(par5EntityPlayer.getHeldItem().itemID == ModPowderCraft.cincel.itemID) { par5EntityPlayer.getHeldItem().stackSize -= 1; //only if you want to use the item when you do this. if(par1World.isRemote) { par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.break", 0.3F, 0.5F, blockConstructorCalled); par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.orb", 0.3F, 0.5F, blockConstructorCalled); int rand = par1World.rand.nextInt(60); if(rand<=8 && rand>=0){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado una Gema Azul"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaazul)); } else if(rand<=16 && rand>={ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado una Gema Roja"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaroja)); } else if(rand<=24 && rand>=16){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado una Gema Verde"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaverde)); } else if(rand<=32 && rand>=24){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado una Gema Blanca"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemablanca)); } else if(rand<=40 && rand>=32){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado una Gema Prisma"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.gemaprisma)); } else if(rand<=42 && rand>=40){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.ArmorFossilCovered)); } else if(rand<=44 && rand>=42){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.ClawFossilCovered)); } else if(rand<=46 && rand>=44){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.CoverFossilCovered)); } else if(rand<=48 && rand>=46){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.DomeFossilCovered)); } else if(rand<=50 && rand>=48){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.HelixFossilCovered)); } else if(rand<=52 && rand>=50){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.OldAmberCovered)); } else if(rand<=54 && rand>=52){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.PlumeFossilCovered)); } else if(rand<=56 && rand>=54){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.RootFossilCovered)); } else if(rand<=58 && rand>=56){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Fosil Cubierto"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.SkullFossilCovered)); } else if(rand<=60 && rand>=58){ ModLoader.getMinecraftInstance().thePlayer.addChatMessage("Has encontrado un Hueso"); par5EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bone)); } return true; } par1World.setBlock(par2, par3, par4, Block.dirt.blockID); return false; } return false; } }
  13. Hi, I'm making a block that on right click (onBlockActivated) gives you an Item, this'll be for an online minigame, so I need it block the use so people don't get 100 Items on 5 seconds... How could I do it?
  14. I fixed it with addItemStackToInventory(new ItemStack(GameRegistry.findItem("pixelmon", "itemname"))); Thaks so much!
  15. I found it in the Mod Main class. Lets try if it works
  16. I don't know Mod's ID... thats why I want to use the ID, but if anyone knows th ID of the PixelmonMod please post it
  17. I've got this ((EntityPlayer)MinecraftServer.getServer().getConfigurationManager().playerEntityList.get(0)).inventory.addItemStackToInventory(new ItemStack(ModPowderCraft.explorerKit)); But I cant use the item ID... I've already look into the CommandGive without getting any idea of how to do it...
  18. Hi, I made a block that on right click executes a random action. I want In all of them to give an Item to the player that clicked the block. This Items are from other mod so i think the best way would be giving it by ID. Thanks
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.