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.

Mightydanp

Members
  • Joined

  • Last visited

Everything posted by Mightydanp

  1. yes i do know what i am doing with the getItemDamage() and such, i do have a quistion, after a built my jar, put some of the class files like this basicly the class files are out of the com folder... when i started it up with regurlar client forge and opened my inventory it crashed with This doesn't make any sense! this is the code that says its crashing public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new TabRegistry()); } am i doing something wrong in my code to cause this or? glaticraft does the same thing in there class https://github.com/micdoodle8/Galacticraft/blob/master/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java
  2. so i am sepost to do something like this? if (nbtDataCompund == null) { // do something? } im just confused right now
  3. after i got a new hard drive reinstalled , i start crashing .. this wasn't happening before this. code http://pastebin.com/H74hDjeC
  4. No ? They just started after ?
  5. na not asking for any help on that stuff just telling them what happenen
  6. Its not java or anything my computer os litarly crashing hard core so im having to do a system restore if that dont work then a clean whip
  7. Im runing into a big problem with my eclipse and java not working
  8. thats not what im talking about.... i asked is there a limit on how much metadata you can use ? for example can i have a item with 1000 metadatas? its a yes or no quistion >.> but you responed with It's a full short, so 0-Short.MAX_VALUE.
  9. what ? you just confused me
  10. ok so heres a good question for later is there a limit on how much metadata you can use ? for example can i have a item with 1000 metadatas?
  11. the reason i'm not making it gain damage with 1 is because i want it to lose damage because the bar on the bottom of the item represents how much is left and thanks for the help i got it to work.
  12. true i did not see it , so you said i have to set it ? i tried to set it with nbtDataCompund.setInteger("coolDown", 0); is that right ?
  13. Its not crashing as o sead its not working meaning its not changing anything after i changed nbtDataCompund = itemStack.stackTagCompound(); to nbtDataCompund = itemStack.getTagCompound();
  14. Not going to argue with you
  15. dude ? you going to reply
  16. im still having the issue where the cooldown still isnt working @Override public void onUpdate(ItemStack itemStack, World world, Entity entity, int i, boolean flag){ super.onUpdate(itemStack, world, entity, i, flag); if (!world.isRemote){ NBTTagCompound nbtDataCompund = itemStack.stackTagCompound; if (nbtDataCompund == null) { itemStack.stackTagCompound = new NBTTagCompound(); nbtDataCompund = itemStack.getTagCompound(); } int coolDown = nbtDataCompund.getInteger("coolDown"); if(coolDown > 0){ --coolDown; nbtDataCompund.setInteger("coolDown", coolDown); } } } @Override public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityplayer, EntityLivingBase entity ){ int coolDown = itemStack.stackTagCompound.getInteger("coolDown"); if(coolDown > 0){ return false; } if(coolDown == 0){ if (entity instanceof EntityMob){ if(itemStack.getItemDamage() > 0){ entity.setHealth(0.0F); if(!entity.worldObj.isRemote){ entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY +"Soul Absurbed!")); } itemStack.damageItem(-1, entityplayer); return true; }else{ if(!entity.worldObj.isRemote){ entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The Magical Stone seems to be full?")); entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "It seems to be useless now.")); entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "I wonder whats inside?")); } return true; } }else{ if(!entity.worldObj.isRemote){ entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "Why has this stoped working?")); } } } itemStack.stackTagCompound.setInteger("coolDown", 180);; return false; } im not trying to copy past but for most people they know nothing about tagCompounds and id rather you yell as me and tell me what im doing wrong and learn it then trying to figure it out myself
  17. you told me to change itemStack.stackTagCompound to something that can go and get the stack compound so i looked thow there was only stacktagcompound and getstacktagcompound... so on this line nbtDataCompund = itemStack.stackTagCompound(); i changed it to nbtDataCompund = itemStack.getTagCompound();
  18. your talking about this ? if (!world.isRemote){ NBTTagCompound nbtDataCompund = itemStack.stackTagCompound; if (nbtDataCompund == null) { itemStack.stackTagCompound = new NBTTagCompound(); nbtDataCompund = itemStack.getTagCompound(); }
  19. i looked up who helped me and it was you who helped me with this.. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1437156-i-need-help-with-a-iteminteractionforentity @Override public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer entityplayer, EntityLivingBase entity ){ if(!entity.worldObj.isRemote){ return false; } int coolDown = itemStack.stackTagCompound.getInteger("coolDown"); if(coolDown > 0){ return false; } if(coolDown == 0){ if (entity instanceof EntityMob){ if(itemStack.getItemDamage() > 0){ entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY +"Soul Absurbed!")); itemStack.damageItem(-1, entityplayer); entity.setHealth(0.0F); return true; }else{ entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The Magical Stone seems to be full?")); entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "It seems to be useless now.")); entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "I wonder whats inside?")); return true; } }else{ entityplayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "Why has this stoped working?")); } } itemStack.stackTagCompound.setInteger("coolDown", 180);; return false; }
  20. ernio posted this i am telling him that there is a dead line in it... as he said "" This code will try to decrement cooldown to zero whenever it's positive (positive = item has cooldown). It also has lazy initialization and will work like charm (mind I wrote it here and am on 1.8, so might made mistake). "" seeing that he just wrote it on here and not cheeking if it works via forge i know that there is something wrong so i am telling him about it..... for the mysterious stone i wrote that maybe maybe 7 or 8 months ago i have no clue what i was thinking but it worked before i changed it to a metadata class so i was seeing if there was a reason it stopped working on me
  21. For NBTTagCompound nbtTagCompound = new NBTTagCompound(); if(nbtTagCompound == null) { // dead code - how can it be null when you just initialized it??? it can't. } i was telling him that i is dead code that his version for 1.8 doesn't work for 1.7.10, that's why i said ernio..... and i realize the nbt portion and im fiddling with it right now
  22. and i seem to be having a small issue for some reason client side it is killing the mobs but server side it doesnt do anything at all to the server they are still alive and can hit me which puzzles me. http://pastebin.com/dXcbmafB
  23. ernio i am getting a dead code in 1.7.10 in this if(data== null){ itemStack.stackTagCompound = new NBTTagCompound(); data= itemStack.stackTagCompound; }
  24. What other ways could i do this ? You sead if i wanted to make it visable to use in my addinformation i would have to do something else then what you put on it ?

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.