Jump to content

nosrick

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by nosrick

  1. Sorry for my ignorance. That fixed it! Thank you both so much, I'm learning a lot by asking questions here. I think I'll hit some more basic tutorials.
  2. So I've got another question. I've got an entity that's meant to poop every now and then. That bit works. It's just that I can't seem to make it manufacture the little poop block that I have made. The block appears fine in world and everything, it's just that I can't get worldObj.setBlock() to do anything. Here's the code for setting it: What am I doing wrong?
  3. Hahaha, holy crap, I totally did not realise that. I'll fix it and see what happens. EDIT: It totally works now. I am so ashamed. Thanks, diesieben07.
  4. So I've got a tile entity (an egg), that has a countdown until it hatches. Saving it seems to work well enough; writeToNBT gets called, and the values are written down as far as I know. But when I load the world, readFromNBT isn't called at all. Code to follow. What am I doing wrong?
  5. I'll keep that in mind the next time something goes wrong. Again, thanks for all the help. I'll mark this as solved.
  6. Starting a new world fixed it. That's really strange. Thanks for all the help! I'll be sure to keep the client/server stuff in mind when coding from here on out, I've learnt a lot thanks to this thread. Expect more questions soon!
  7. I hope this isn't a really dumb answer, but... By right-clicking. It should be a pretty standard procedure.
  8. So would that be a problem in createNewTileEntity(), or elsewhere?
  9. Okay, I've moved all of the logic to the server. My problem now is the fact that isRemote always returns true, meaning that nothing happens at all.
  10. The tile entity trying to spawn an entity, and destroy itself (where the isRemote check is) The custom block:
  11. Posting from my phone, so forgive any formatting errors. I've already put a world.isRemote around the spawning and block deletion, but when I do, it causes nothing to happen.
  12. I have no idea! Totally new to this, so I stupidly assumed Minecraft would handle this sort of thing on its own. How do I do that?
  13. The creature now spawns, but I can't interact with it for some reason. I get the feeling I'm missing quite a lot and it isn't as simple as just using spawnEntityInWorld. I've now put the setBlockToAir inside an if(!world.IsRemote) but now the block won't delete itself at all. I'm going to bed for now, so I'll check back in a few hours.
  14. EDIT: I apologise in advance for anything that might be wrong with my code. No comments due to me just trying to bang this out, and my Java is a little rusty, so I might not be doing best practises. The block: The tile entity:
  15. I do, it creates the TileEntity when placed. Here's the outline of what I'm trying to do; Place down an egg (Not vanilla Minecraft one) When it receives enough heat, it hatches, deleting itself and spawning a creature. So far, I've got the egg placing down fine, it receives heat just fine and it hatches just fine. The only problems I'm having are with it deleting itself (only happens clientside for some reason) and spawning a creature (spawnEntityInWorld does nothing).
  16. So how would I go about accessing that block for the onBlockActivated method? Would I go through this.blockType, or would it be an Override? (which I don't think I can do) On top of that, how am I meant to know what parameters onBlockActivated takes? It's just a bunch of unnamed, undocumented ints, floats, a World and an EntityPlayer.
  17. I made a mistake in my opening post; it's a tile entity, not a block, so onBlockActivated isn't available to me. 1) How would I go about doing that? 2) As above, it's a tile entity. I did try the EntityCreeper creeper = new EntityCreeper then spawning it through spawnEntityInWorld(creeper), but again, nothing came of it. I'm currently trying to do it in updateEntity, as that's where the egg's (the tile entity in question) hatching logic is.
  18. Sorry I'm asking so much today, I'm brand new to modding and all of this is a bit overwhelming. Just two questions for now; How do I make a block destroy itself? I tried use worldObj.setBlockToAir but that leaves behind the bounding box for some reason (and when the tile is right clicked, the block respawns). And how do I spawn a mob out of a block? I've tried worldObj.spawnEntityInWorld, but nothing comes out of it. Any help is greatly appreciated.
  19. That was my problem! I'll get the surrounding light values and average them out, not taking into account any 0s. Thanks so much! Going to mark this as solved.
  20. I'm hoping someone can help me out with this; I need to get the light level cast upon a tile entity, as I'm trying to simulate the heat used to hatch an egg. Is this possible? I've looked around, but haven't found anything useful. getLightBrightness and getBlockLightValue both return a constant 0.0. If it's not possible, what other methods could I use to simulate the heat required to hatch an egg?
×
×
  • Create New...

Important Information

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