Jump to content

Jeerdus

Members
  • Posts

    104
  • Joined

  • Last visited

Everything posted by Jeerdus

  1. How would I get the biome name that the player is in?
  2. Good day, I have another problem: The EntityJoinWorldEvent uses Entity, not EntityLiving. Entity doesn't have isChild, so I cant check if the Entity is a child. How would I get around that? Thank you.
  3. I used MinecraftForge.EVENT_BUS.register(new TModEvents());
  4. The event doesn't fire, the PlayerTickEvent and not even the WorldTickEvent. That's why I added the println in it, to test if it fires.
  5. I have a problem. It doesn't want to work: @SubscribeEvent public void onThunder(PlayerTickEvent event){ int chanceOfStriking = random.nextInt(100); System.out.println(chanceOfStriking + String.valueOf(event.player.worldObj.isRaining()) + String.valueOf(!event.player.worldObj.isRemote)); if (event.player.worldObj.isThundering() && !event.player.worldObj.isRemote && chanceOfStriking == 1){ int posX = (int) (event.player.posX + (random.nextInt(1024)-512)); int posZ = (int) (event.player.posZ + (random.nextInt(1024)-512)); EntityLightningBolt entityLightningBolt = new EntityLightningBolt(event.player.worldObj, posX, 64, posZ); event.player.worldObj.addWeatherEffect(entityLightningBolt); event.player.worldObj.spawnEntityInWorld(entityLightningBolt); spawnCoinOnLightning(event, 5); } } @SubscribeEvent public void onPlayerReachY(PlayerTickEvent event){ if(event.player.posY > 250){ int per = random.nextInt(3); if (per == 1) spawnCoinOnPlayerInY(event, 2); } } public void spawnCoinOnLightning(PlayerTickEvent event, int coinType){ event.player.worldObj.spawnEntityInWorld(new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(TModItems.coinCollectable, 1, coinType))); } public void spawnCoinOnPlayerInY(PlayerTickEvent event, int coinType){ event.player.worldObj.spawnEntityInWorld(new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(TModItems.coinCollectable, 1, coinType))); } What am I doing wrong?
  6. Ok thanks!
  7. Also how would I get a random position around the player?
  8. Thank you for your response! I'll definitely take a look at those.
  9. Good day. I've recently started working with events but I'm still quite new to them, so I would like to know where to find these following events: - When lightning strikes a block. - When animals have a baby (or when they spawn the baby) - When the player is in a certain height - When the it's a certain time I'd be really grateful if you could tell me where to find these. Thank you.
  10. Thanks for the help! Managed to figure it out!
  11. Good day. I would like to ask how to drop an item from an already existing block in the game (for example Stone). It would probably involve events, but I don't know what events. Thank you.
  12. Oop! That did the trick! Thanks!
  13. Good day. I would like to know, how to recolour/tint items to a certain colour. I have an basic item with metadata and a black and white image and each metadata has a colour appointed to it which I'll then read to recolour the item. I would like to know if there's a method to do it or any other way. Thank you.
  14. Good day. I am currently facing a problem that I dunno how to solve. I have two slots: One of them is an input slot and the other one is an output slot. If you put a certain item and amount in the input slot, an itemstack appears in the output slot. If you take out the itemstack from the input slot, the itemstack in the output slot dissappears (Think of an crafting table). I don't want to do all the crafting matrix things, so I would prefer to solve it directly. I tried some things but I couldn't get it to work (either got a crash or loads of unsolvable errors). Thank you for reading. (Will provide any code if you ask for it)
  15. Good day. I'm currently making a coin mod for our server and it has a wallet, which has a security lock that doesn't allow you to open wallets that don't belong to you. I have made it work, except I ran into a big problem. When you create a wallet, you can open it, but when you exit and save to menu and then load up the world again, even tho the NBT is saying the correct name, it doesn't want to open, says it doesn't belong to me! Here's my code for the item where all the action happens:
  16. Ah! That did the trick! Thank you very much for your quick response!
  17. Good day! I have a minor problem which I cant seem to be able to fix. I have an onItemRightClick method with which I open an inventory. I also have a "security" lock, which makes only the player who creates the item be able to open it, and when you try to open the inventory and it doesn't belong to you, it writes a client side text message in the chat. But the problem is that it gets written twice in the chat. Here's the code of the Item: Thank you for your help!
  18. Good day. I'm currently working on an item that has about 45 metadata items and the first 15 icons have the same background as the next 15 icons, which are the same as the last 15 background icons. But the overlay has the same icon for all the first 15 icons aswell as the second 15 icons and the last 15 icons. I am asking how to do it. Thank you. PS: I'll give you any files if you need them.
  19. Good day. I'm struggling with multilayered textures for items. I have 45 metadatas in the item and 2 icon arrays which I would like to combine into one icon. So I would like to ask you, if there isn't any way of doing it. Thanks!
  20. Thank you really much! Now it finally works.
  21. And what can I do about it? I'm sorry but I am not that good at Java just yet.
  22. It's still not working though.
  23. I've tried something (and I'm probably doing it wrong again), but it doesn't want work. Changes are on GitHub.
  24. And how does one do that? I've never actually worked with packets.
×
×
  • Create New...

Important Information

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