Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LemonLake

Members
  • Joined

  • Last visited

  1. So far, it works like a charm! Thanks!
  2. public int getSpellId(ItemStack stack){ return stack.getTagCompound().getInteger("spell"); } Correct?
  3. How would I store NBT in an item?
  4. Spell should be an int, right? I only really need the object instance for the variables, nothing is stored in it really. Edit: How would I go about storing NBT in an item?
  5. It's not too much of a problem, I can simply use onBlockActivated on the Spell Table block. Unfortunately, I cannot use these functions for other spells
  6. After adding castAir=true; to the constructor of NullItem, and adding your code to castAirEvent, then finally right clicking towards the sky, I just got 2013-08-09 15:25:29 [iNFO] [sTDOUT] client side thinks: true. No mention of serverside.
  7. Re-read, please.
  8. Description Resource Path Location Type getEffectiveSide cannot be resolved or is not a field Spell.java /Minecraft/src/lemmy/eldercraft line 49 Java Problem Edit: Added parenthasis to the end of getEffectiveSide, testing now. 2013-08-09 15:19:19 [iNFO] [sTDOUT] client side thinks: true
  9. public void castSpellBlockFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ) { System.out.println("1"); if(!world.isRemote&&world.getBlockId(x,y,z)==Items.block_spelltable.blockID&&side==1){ System.out.println("2"); if(player.inventory.getStackInSlot(0)!=null){ System.out.println("3"); if(player.inventory.getStackInSlot(0).itemID!=Items.item_apprenticewand.itemID){ /* Here's the items that can turn into spells */ System.out.println("4"); switch(player.inventory.getStackInSlot(0).itemID){ case 370: System.out.println("5"); player.inventory.consumeInventoryItem(Items.item_apprenticewand.itemID); player.inventory.consumeInventoryItem(Item.ghastTear.itemID); player.inventory.addItemStackToInventory(new ItemStack(Items.item_apprenticewand_soul, 1, 0)); break; default: System.out.println("6"); player.addChatMessage("§cNo available items found in first slot"); break; } System.out.println("7"); }else{ System.out.println("8"); player.addChatMessage("§cWands cannot be transmuted"); } }else{ System.out.println("9"); player.addChatMessage("§cNo available items found in first slot"); } System.out.println("10"); } System.out.println("11"); } 2013-08-09 15:10:12 [iNFO] [sTDOUT] 1 2013-08-09 15:10:12 [iNFO] [sTDOUT] 11
  10. Here's four classes: ItemWand, Spell, NullSpell (the one I'm referencing in my first post) and SoulSpell: ItemWand.java: Spell.java: NullSpell.ava: SoulSpell.java Summary: There are events in ItemWand. In spell, there are functions such as castSpellBlockFirstEvent. These do a few checks, then call castSpellBlockFirst. The event functions are called in ItemWand, and the non-event functions are overriden in the new spell.
  11. I thought that was the problem, but ignored it because in another spell I used it and thought I used it in my base function. Thanks! EDIT: Now nothing happens when I right click, and I have a similar problem with my Soul Spell. public void castSpellBlockFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ) { if(!world.isRemote&&world.getBlockId(x,y,z)==Items.block_spelltable.blockID&&side==1){ if(player.inventory.getStackInSlot(0)!=null){ if(player.inventory.getStackInSlot(0).itemID!=Items.item_apprenticewand.itemID){ /* Here's the items that can turn into spells */ switch(player.inventory.getStackInSlot(0).itemID){ case 370: player.inventory.consumeInventoryItem(Items.item_apprenticewand.itemID); player.inventory.consumeInventoryItem(Item.ghastTear.itemID); player.inventory.addItemStackToInventory(new ItemStack(Items.item_apprenticewand_soul, 1, 0)); break; default: player.addChatMessage("§cNo available items found in first slot"); break; } }else{ player.addChatMessage("§cWands cannot be transmuted"); } }else{ player.addChatMessage("§cNo available items found in first slot"); } } }
  12. LemonLake replied to Fuzioncap's topic in Off-topic
    Google will be your guide through your life. http://dev.bukkit.org/bukkit-plugins/death-messages/
  13. Just press the F3 key.
  14. I am having a problem with items in Forge 9.10.0.804. When I create my new item using two old items, I recieve the new one fine, however as soon as I click it my inventory resets to it's previous state. The video explains it better: [flash=640,360]https://youtube.googleapis.com/v/NXLulVE8x8k Here is my code for swapping the items: public void castSpellBlockFirst(ItemStack stack,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ) { if(world.getBlockId(x,y,z)==Items.block_spelltable.blockID&&side==1){ if(player.inventory.getStackInSlot(0)!=null){ if(player.inventory.getStackInSlot(0).itemID!=Items.item_apprenticewand.itemID){ /* Here's the items that can turn into spells */ switch(player.inventory.getStackInSlot(0).itemID){ case 370: player.inventory.consumeInventoryItem(Items.item_apprenticewand.itemID); player.inventory.consumeInventoryItem(Item.ghastTear.itemID); player.inventory.addItemStackToInventory(new ItemStack(Items.item_apprenticewand_soul, 1, 0)); break; default: player.addChatMessage("§cNo available items found in first slot"); break; } }else{ player.addChatMessage("§cWands cannot be transmuted"); } }else{ player.addChatMessage("§cNo available items found in first slot"); } } } Any help would be appreciated. If you need any information, just post or PM.
  15. You beat me to it, but then my post disappeared

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.