StretchFre
Members-
Posts
8 -
Joined
-
Last visited
Everything posted by StretchFre
-
Thank you. I will start working on it.
-
I am trying to add and remove from loot tables.
-
I have been getting into modding recently and have no idea how to even get started adding items to loot tables. I might be able to figure out how to make one, but when it comes to simply removing or adding to them in my mod i cannot seem to figure it out. Does anybody have any forbidden loot table knowledge they could share with me?
-
Making a block disappear on right click with item error...
StretchFre replied to StretchFre's topic in Modder Support
Thanks... But how do i make it so getHeldItem() is not null? -
Making a block disappear on right click with item error...
StretchFre replied to StretchFre's topic in Modder Support
Okay, thanks for attempting to help. What i do not understand is i did exactly what you said to do(without the chat thing) but it crashes still. here is my code: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int coords, float one, float two, float three) { if(player.getHeldItem().getItem() != null) { if(player.getHeldItem().getItem() == MyMod.olKey) { world.setBlock(x, y, z, Blocks.air); player.inventory.consumeInventoryItem(MyMod.olKey); } else { System.out.println("Are you trying to unlock it with THAT?"); } } else { System.out.println("Stpo trying to pry it open"); } return super.onBlockActivated(world, x, y, z, player, coords, one, two, three); } -
Making a block disappear on right click with item error...
StretchFre replied to StretchFre's topic in Modder Support
Okay. Now i got a different problem...i tried fixing it a bit, but it still crashes when i right click with nothing in my hand... @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int coords, float one, float two, float three) { Item item = player.getCurrentEquippedItem().getItem(); if(player.getHeldItem() != null) { if(item == MyMod.olKey) { world.setBlock(x, y, z, Blocks.air); player.inventory.consumeInventoryItem(MyMod.olKey); System.out.println("Old Dungeon unlocked"); } else { System.out.println("Are you trying to unlock it with THAT?"); } } else { System.out.println("Stpo trying to pry it open"); } return super.onBlockActivated(world, x, y, z, player, coords, one, two, three); } -
Making a block disappear on right click with item error...
StretchFre replied to StretchFre's topic in Modder Support
Sorry... i am using eclipse, and i have no idea how to override automatically with it. How do i do this? I tried adding @Override annotation to it(above it) and it did not work, giving me a error. I have no idea how to fix it. Please do not get angry, i am a beginner and have no idea how to @Override, eventhough i know most of the basics. EDIT: OKay.... wow. Yeah your right it was WAY too simple. Sorry to waste your time. -
Hello. Nothing happens when i try to use this code i entered into my mod's block class file: public boolean onBlockActivated(Block block, World world, EntityPlayer player, Item item, ItemStack itemstack, int x, int y, int z) { if(player.inventory.getCurrentItem().getItem() == Items.bone) { world.setBlock(x, y, z, Blocks.air); System.out.println("rightclick worked"); return true; } return true; } nothing happens. What am i doing wrong? (also, my block file extends Block)