314owen
Members-
Posts
36 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
314owen's Achievements
Tree Puncher (2/8)
0
Reputation
-
Tile Entities Not Spawning in Generated Structure
314owen replied to 314owen's topic in Modder Support
HauntedHouse Gen: http://pastebin.com/Nc1p1Psx WorldGenerator: http://pastebin.com/4Y9xayG9 Block: http://pastebin.com/tZQzj0ak Tile Entity: http://pastebin.com/rG96ZiWH -
Tile Entities Not Spawning in Generated Structure
314owen replied to 314owen's topic in Modder Support
I'm Just Using Basic setBlock Code Under My Generate Method: First I tried this: world.setBlock(i + 2, j + 6, k + 3, MyMod.MyBlock); Then I tried this: TileEntityMyBlock block = new TileEntityMyBlock(); world.setTileEntity(i + 2, j + 6, k + 3, block); Then I tried both. Here is my block class: public class BlockMyBlock extends Block{ protected BlockMyBlock(Material p_i45394_1_) { super(p_i45394_1_); } public TileEntity createTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityMyBlock(); } public boolean hasTileEntity(int metadata) { return true; } } -
Tile Entities Not Spawning in Generated Structure
314owen replied to 314owen's topic in Modder Support
The Block does not get placed either way. -
I am trying to put my modded block into my structure. When I remove the tile entity code from the block, It places fine, but I need to have it have the tile entity code. How do I fix this? I have tried using .setBlock and .setTileEntity
-
I did start using that, But the problem is, I also have to update all of the .setBlockAndMetadata things with .setBlock and add ,2 at the end. There is no way to do that with search and replace. Is there no tool that is updated to 1.7?
-
How can I efficiently update the code with over 6000 blocks? I would have to update every block. How far are you into updating the tool?
-
How would I make random generated structures? I have tried a program called "SchematicToJava Converter" but the program is too old and all of the code generated is outdated. What should I use to transfer my dungeon schematic into java worldgen code.
-
Okay, I updated the code, It still does not work. Block: package net.endernoobs.rpgmod; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.world.World; public class BlockGrimReaper extends Block{ protected BlockGrimReaper(Material p_i45394_1_) { super(p_i45394_1_); } public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityGrimReaper(); } public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return null; } @Override public boolean hasTileEntity(int metadata) { return true; } } Tile Entity: package net.endernoobs.rpgmod; import net.minecraft.tileentity.TileEntity; public class TileEntityGrimReaper extends TileEntity { private int activatingRangeFromPlayer = 16; public boolean isActivated() { System.out.println("Active"); return this.worldObj.getClosestPlayer((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D, (double) this.activatingRangeFromPlayer) != null; } @Override public void updateEntity() { System.out.println("Is it active?"); if (this.isActivated()) { EntityGrimReaper boss = new EntityGrimReaper(worldObj); this.worldObj.spawnEntityInWorld(boss); this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord); } } }
-
How do I do that?
-
I want to exactly like I say: Spawn a Mob when the player is near this block. Block: package net.endernoobs.rpgmod; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.world.World; public class BlockGrimReaper extends Block{ protected BlockGrimReaper(Material p_i45394_1_) { super(p_i45394_1_); } public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityGrimReaper(); } public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return null; } } Tile Entity: package net.endernoobs.rpgmod; import net.minecraft.tileentity.TileEntity; public class TileEntityGrimReaper extends TileEntity { private int activatingRangeFromPlayer = 16; public boolean isActivated() { return this.worldObj.getClosestPlayer((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D, (double) this.activatingRangeFromPlayer) != null; } public void updateEntity() { if (this.isActivated()) { EntityGrimReaper boss = new EntityGrimReaper(worldObj); this.worldObj.spawnEntityInWorld(boss); this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord); } } }
-
I tried doing what you said, but for some reason, the tile entity is not detecting players. Here is the code for the tile entity: package net.endernoobs.rpgmod; import net.minecraft.tileentity.TileEntity; public class TileEntityGrimReaper extends TileEntity { private int activatingRangeFromPlayer = 16; public boolean isActivated() { return this.worldObj.getClosestPlayer((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D, (double) this.activatingRangeFromPlayer) != null; } public void updateEntity() { if (this.isActivated()) { EntityGrimReaper boss = new EntityGrimReaper(worldObj); this.worldObj.spawnEntityInWorld(boss); this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord); } } }
-
Thanks, I think that might work.
-
It really wouldn't matter, I would just need a way for it to be there when the player is in the dungeon. Not sure how other mods do it.
-
I am Making this mod in 1.7.2