Everything posted by Busti
-
Spawn entities with a item
That means that java can't create a new Instance of the class because its abstract... My bad use EntitySmallFireball
-
Spawn entities with a item
I started a bit like you... My goal was to put XP Orbs in pipes. So i created a Block that pushed every xp orb into the air... When I wanted to know how something works I looked how Minecraft did it or i asked here. Follow you ideas and If something doesn't work just ask why. Starting can be a bit hard but its totally worth it
-
[1.6.4]Block takes items from entity's inventory
You have to use findEntitysWithinAABB(); in 1.6
-
Spawn entities with a item
Create the entity like so: public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { Vec3 v3 = player.getLook(); EntityFireball fireball = new EntityFireball(world, player, v3.xCoord, v3.yCoord, v3.zCoord); world.spawnEntityInWorld(fireball); } EDIT: You might need to mess around with the vars a bit... (EntityGhast is a good learning source.)
-
[1.6.4]Block takes items from entity's inventory
Use this to detect the player(s) and put them in the list. worldObj.selectEntitiesWithinAABB(); Then use an Iterator to run through the list. Once you have a player entity use player.inventory to access the players Inventory. Then check the inventory slots for your item and transfer a copy of that item into the chest. When that's done delete the Itemstack in the players inventory. I hope that helps Busti
-
[1.7.2] Would this work? Some questions about modding
Why don't you create a TileEntity?
-
Spawn entities with a item
This will go into your item class... public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { world.spawnEntityInWorld(new YourEntityClass()); } EDIT: Have a look at EntityEgg or ItemEgg if you want to know how they solve the block detection. (raytrace)
-
Player arm rotation in 3rd person!
This tutorial by Ichun (the creator of the portalgun mod) shows how to create custom rendered Items. He also shows how to edit the players arm rotation. Its a bit old but most of the code is still working. Good luck Busti
-
package net.minecraftforge issue
You have to use the Install.cmd script in the forge folder. It will set up you mcp folder. Or just use 1.7 its much easier now
-
Damage Item on crafting...
Thanks... That worked
-
Damage Item on crafting...
Hello, is there a way to damage an (tool)item when its used in a recipe but not consume it and let it remain in the crafting grid? Any help would be greatly appreciated... Busti
-
[1.7.2]World Generation Not Working
The tutorial is fine but somebody should add the *16...
-
[1.7.2] NBT data from smelting input to output
You might want to have a look at: package net.minecraft.item.crafting.ShapedRecepies.class . You have to create a custom crafting hander (implementing IRecepie) which parses the NBT data to the result. Even though this is for crafting it will also apply to crafting.
-
[1.7.2]World Generation Not Working
You have to multiply the chunkX and chunkZ by 16. Or just use my class: Then just use the addOre method in your Registry... EDIT: I forgot the package
-
Ore not generating...
When I do it with my blocks each chunk takes about 10 seconds more to generate but when I do it with a Vanilla block it doesn't. Even though nothing is really generating
-
[1.7.2] Block list
Its now called Block.blockRegistry but you need to get the blocks by using a mapping key since it is using maps instead of an array now.
-
Ore not generating...
Yes I am. The generate method gets called but nothing generates. It also takes a very long time but i cant imagine where the delay comes from.
-
Ore not generating...
Hello, I tried to add an ore to the world gen and I followed the common tutorials. I tried to add some structure to it to make it easier, but somehow it isn't working: Registration: public static void Init() { //Generators OreGen oreGen = new OreGen(); oreGen.addOre(block_CopperOre, 10); GameRegistry.registerWorldGenerator(oreGen, 500); } Gen Class: /* * Copyright (c) 2013-2014 Busti2000. * * Technica is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ package mlb.technica.core.world; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.terraingen.TerrainGen; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; public class OreGen implements IWorldGenerator{ private final List<WorldGenMinable> oreGenList = new ArrayList<WorldGenMinable>(); public void addOre(Block block, int number) { oreGenList.add(new WorldGenMinable(block, number)); } public void genStandardOre(int count, World world, WorldGenerator worldGen, Random random, int chunkX, int chunkZ, int min, int max) { for (int i = 0; i < count; i++) { int x = chunkX + random.nextInt(16); int y = random.nextInt(max - min) + min; int z = chunkZ + random.nextInt(16); worldGen.generate(world, random, x, y, z); } } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { Iterator<WorldGenMinable> iter = oreGenList.iterator(); while(iter.hasNext()) { WorldGenMinable ore = iter.next(); if (TerrainGen.generateOre(world, random, ore, chunkX, chunkZ, OreGenEvent.GenerateMinable.EventType.CUSTOM)) genStandardOre(20, world, ore, random, chunkX, chunkZ, 0, 96); } } }
-
Why can't you add mods into the mods folder while development?
He did not but you can use his repos with some fixing...
-
Replace an block
Item and Block mappings are stored in the GameData class. You can get a block mapping by using the GameData.blockRegistry.get("NAME"); command but there is no real method to easily remove that entry. You could try using the itreator of the map but I have not tried that.
-
Hot-Swap code in IntelliJ IDEA?
- Hot-Swap code in IntelliJ IDEA?
Hello, is it possible do Hot-Swap Code while Minecraft is running in Debug Mode? I tried it but it says the VM does not support it. Busti- [1.6.4]Detecting a specific entities in a custom command!?
Use world.getEntitiesWithinAABB(yourEntityClass, AxisAlignedBB); it will return a list wit all entities found inside the given box.- HELP ME! Building Mod Fails
I had this once... Is your JDK up to date?- Store tags directly in a tag list?
Is it possible to store a tag directly in a tag List or do I have to create a TagCompound? Busti - Hot-Swap code in IntelliJ IDEA?
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.