Jump to content

Jeerdus

Members
  • Posts

    104
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed

Jeerdus's Achievements

Creeper Killer

Creeper Killer (4/8)

0

Reputation

  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:
×
×
  • Create New...

Important Information

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