Everything posted by Jeerdus
-
[1.8] Need to find few events
How would I get the biome name that the player is in?
-
[1.8] Need to find few events
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.
-
[1.8] Need to find few events
I used MinecraftForge.EVENT_BUS.register(new TModEvents());
-
[1.8] Need to find few events
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.
-
[1.8] Need to find few events
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?
-
[1.8] Need to find few events
Ok thanks!
-
[1.8] Need to find few events
Also how would I get a random position around the player?
-
[1.8] Need to find few events
Thank you for your response! I'll definitely take a look at those.
-
[1.8] Need to find few events
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.
-
[1.8] Drop item from a vanilla block
Thanks for the help! Managed to figure it out!
-
[1.8] Drop item from a vanilla block
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.
-
[1.8] How do I recolour/tint items?
Oop! That did the trick! Thanks!
-
[1.8] How do I recolour/tint items?
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.
-
[1.8] Detect if itemstack is put in a slot and do things in other slot
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)
-
[1.8] Problems with opening "backpack" when reloading game
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:
-
[1.8] Text gets written twice in chat
Ah! That did the trick! Thank you very much for your quick response!
-
[1.8] Text gets written twice in chat
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!
-
Merging two icon arrays
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.
-
Multilayered textures for items
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!
-
[1.6.4] Moving container slots
Thank you really much! Now it finally works.
-
[1.6.4] Moving container slots
And what can I do about it? I'm sorry but I am not that good at Java just yet.
-
[1.6.4] Moving container slots
Done.
-
[1.6.4] Moving container slots
It's still not working though.
-
[1.6.4] Moving container slots
I've tried something (and I'm probably doing it wrong again), but it doesn't want work. Changes are on GitHub.
-
[1.6.4] Moving container slots
And how does one do that? I've never actually worked with packets.
IPS spam blocked by CleanTalk.