
DaveTheModder
Members-
Posts
19 -
Joined
-
Last visited
Everything posted by DaveTheModder
-
I would agree, but I've seen other mods do it the same way with apparently no issues. Maybe I should create a custom WorldChunkManager?
-
I'm trying to create custom dimensions. For development purposes only, I have it so that when a certain shovel is right-clicked, the player teleports to the dimension. The problem is that whenever I right click the shovel it takes me to the dimension for a tiny bit of time, but then takes me to the nether. Occasionally, it'll take me to the dimension, but not often. Here is my WorldProvider class: Here is my ChunkProvider class: If it helps, here is my custom BiomeGen: Any ideas what is causing the problem? Thanks for help!
-
I have a class called ArrowCount which creates a string of text to render on the screen. It renders fine, but when I try to reposition it, the text moves when changing the gui size in the Minecraft settings. Here's my class: public class ArrowCount { private static Minecraft mc = Minecraft.getMinecraft(); public static int arrowCount = 20; public static void renderToHud() { if((mc.inGameHasFocus) || (mc.currentScreen != null) && (mc.currentScreen instanceof GuiChat) && !mc.gameSettings.showDebugInfo) { ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); FontRenderer fontRender = mc.fontRendererObj; int width = res.getScaledWidth(); int height = res.getScaledHeight(); int arrows = arrowCount; String arrowCount = "Arrows: " + arrows; int x = width / 2; int y = (height / 2) + 82; int color = 0xffffff; mc.fontRendererObj.drawStringWithShadow(arrowCount, x, y, color); } } } I thought about this, and I'm pretty sure that because in the integer y, when I added 82, it always displays it in the same spot because 82 is static and will not change. Does anyone know how I can have the text in the same spot no matter what size the gui is? Thanks
-
Ok, I changed it to this: <code>public class ModEventHandler { @SubscribeEvent public void interact(PlayerInteractEvent event) { Action action = event.action; EntityPlayer player = event.entityPlayer; World world = player.worldObj; Block block = world.getBlockState(event.pos).getBlock(); if(action != event.action.RIGHT_CLICK_AIR) { if(action == event.action.RIGHT_CLICK_BLOCK) { System.out.println("UUUUUUUUUUU"); if(block == Blocks.chest) { if(!world.isRemote) { EntityZombie entity = new EntityZombie(world); entity.setPosition(player.posX, player.posY + 2, player.posZ); world.spawnEntityInWorld(entity); world.setBlockState(event.pos, Blocks.bedrock.getDefaultState()); } } } } } }</code> And it still gives me the same error. It directs me to the line where I define the block variable. EDIT: Oh. Derp. Don't answer this yet.
-
I got rid of the part where it checks to make sure block != null, and it still gives me the error Here's my code: <code>public class ModEventHandler { @SubscribeEvent public void interact(PlayerInteractEvent event) { Action action = event.action; EntityPlayer player = event.entityPlayer; World world = player.worldObj; Block block = world.getBlockState(event.pos).getBlock(); if(action.RIGHT_CLICK_BLOCK != null) { System.out.println("UUUUUUUUUUU"); if(block == Blocks.chest) { if(!world.isRemote) { EntityZombie entity = new EntityZombie(world); entity.setPosition(player.posX, player.posY + 2, player.posZ); world.spawnEntityInWorld(entity); world.setBlockState(event.pos, Blocks.bedrock.getDefaultState()); } } } } }</code>
-
That successfully sets the block and summons the entity, but if I right click anything but a chest, even air, it crashes, saying this:
-
I'm working on a 1.8 mod, and I'm having trouble setting and getting blocks. What I'm trying to do is spawn an entity when a chest is right clicked, but I can't figure out how to do it. Here is how I'd do it prior to 1.8: public class ModEventHandler { @SubscribeEvent public void interact(PlayerInteractEvent event) { Action action = event.action; EntityPlayer player = event.entityPlayer; World world = player.worldObj; Block block = world.getBlock(event.x, event.y, event.z); if(action.RIGHT_CLICK_BLOCK != null) { if(event.world.getBlock(event.x, event.y, event.z) == Blocks.chest) { if(!world.isRemote) { EntityZombie entity = new EntityZombie(world); entity.setPosition(event.x, event.y + 2, event.z); world.spawnEntityInWorld(entity); world.setBlock(event.x, event.y, event.z, Blocks.bedrock); } } } } } But I'm not sure how to accomplish this in 1.8, as there are no setBlock/getBlock methods. How can I do this?
-
[SOLVED] [1.8] Block Rendering Troubles
DaveTheModder replied to DaveTheModder's topic in Modder Support
Oh. Derp. Thanks for your help! -
Hey all, I'm working on a 1.8 mod, and I'm having trouble with the JSON files. No matter what I do, it always gives an error in the console and shows the default black/purple texture on the block. Here's the error: Here is my assets/dark/models/item/darkGrass.json (FWI, dark is my modid and darkGrass is the variable name of my block.) Here is my assets/dark/models/block/darkGrass.json: Here is my assets/dark/blockstates/darkGrass.json: I render the block in init using: Any idea what's wrong? Thanks for all help!
-
Ah, well, I guess if nothing works I could just have it chase the player as an EntityMob but never actually hurt him. Thanks for your help!
-
What works: What doesn't work:
-
Erm... Not exactly the question I had in the post, but I appreciate the thought!
-
Bumperino. If anyone has a solution to this, I'd appreciate all help! (NOTE: I didn't see anything in the rules banning bumping, so... @_@)
-
Here's my RenderNPC: Here's my ClientProxy:
-
Yup.
-
Hey all, I'm working on a simple npc mod for personal use. EntityNPCCompanion has a Render class that extends RenderBiped and uses ModelBiped. For some reason, whenever I have him extend EntityTameable, he glitches out and falls through the world. Here's my code: Does anyone know what's wrong? Thanks for your help!
-
Hey all, I'm trying to create an NPC mod for personal use. I might release it, but I'm not sure. I want to have the textures cycle through about 5-10 different textures after onInteract. How would I do this? I looked into the Ghast and Zombie render classes to find how they change textures, but didn't see anything decipherable. Can anyone run me through on how something like this would work? Thanks for all help!
-
Thanks for your help, I figured it out!
-
I've been trying to create a tameable entity, but I hit a roadblock. I can't get it to follow the player. I can do it by telling it to attack the player in the AI, but not actually hurt it, but then, it just keeps following the player at an... uncomfortably... close distance. Here's my code: How can I make it follow the player? Or, better yet, make it tamed when I right click it with a certain item? Thanks for all help!