Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to course page

Forging a Minecraft mod

Basic Minecraft modding with Minecraft Forge

How to spawn an item in the world

  • 2013-08-12 11:01:00
    What can I use?

    my goal is making a block that when a certain thing happen, a certain item will appear above the block
  • 2013-08-12 11:25:50
    You can use the EntityItem class from minecraft and spawn an entity in the world with spawnEntityInWorld using the paramters of the coordinates and an itemstack.
  • 2013-08-12 13:43:20
    thanx! :D you are right... i can use that, but....i have now another problem...how do i get an itemstack from any item? i have the id, the item, but how do i convert it into a itemstack?
  • 2013-08-12 14:32:40
    new ItemStack(item, quantity, damage value)
    The last two are optional, you can also just give the item.
  • 2013-08-12 20:16:20
    correct again! :)

    now i have another problem a little more complex...

    i wanna make a block that has a metadata and a inventory when i break the block it should spawn the content of the inventory AND if the metadata is A it should spawn X item too, if the metadata is B it should spawn Y item....etc

    i followed the tutorial so i have no problems spawning the inventory when you break the block....but when revising the metadata to spawn the aditional item im having problems...aparently it only works once....but when i place the block again and set the metadata again, breaking it does not spawn the item it should spawn (still spawn the inventory tho)

    here is the pastebin

    http://pastebin.com/BrnH5QmL
  • 2013-08-13 08:39:24
    hmm... the code looks fine to me. you might want to print out some variables to see if things is working correctly.

    for example: you can add
    System.out.println("block: "world.getBlockMetadata(x, y, z));
    to the part before you add your itemstack and
    System.out.println(tool.itemID + " " + tool.getItemDamage());
    to the part before you set your spawnX.

    then, run minecraft, set your blocks and break it and see what the console outputs. from there, you try and see where you problem might lie. this is how i debug my program but there are many more better ways to do it.
  • 2013-08-13 12:22:08
    im lost....i cannot find the problem...as i told you...it works perfectly fine....once.... then it stop working... i tried debuging that but it print the same when it works and when it doesn't

    and is not just when breaking blocks... i tried another thing...

    i tried to make a block with metadata...when you right click the block with certain item in hand it change his metadata, consume your item in hand and spawn another item....and i have the same problem... it consume my item in hand, change the metadata with no problems...but only spawn the item once....then it stops working...so i must restart the game so it can work once again...

    so i think the problem is when spawning entities

    here is the pastebin

    http://pastebin.com/ET1C1yEV

    the spawning item is mostly the same as onblockbreaking

    if you guys need it i can send you my whole source code so you can test it by yourself....
  • 2013-08-13 13:34:00
    From where do you get the mixingbowl, the mortar and the cutting board? Are these ItemStacks that you create in the block? If so, you'll have to do things like:

    tool = mortar.copy();

    If my suspicion is correct, what's happening is that you've already dropped THE mortar once and since you're not making a new one you can't drop it again. Copying the mortar itemstack will make sure that you drop a new mortar and won't affect the existing one.
  • 2013-08-14 09:54:44
    mmmmm.....that's genius! it sounds like a good possibility.... i need to try it out....

    but sadly i have another problem... a really freaking weird one....

    i don't know why eclipse is not recognizing my workspace, the path of the workspace is the same as always (C:\Users\Gazz\Desktop\Anibal\Proyectos\KionashiMods\eclipse).... I manually checked my folders with my classes and there are all where they should be.... but somehow eclipse is just opening an empty project...

    yesterday it worked perfectly.... maybe my brother deleted something by accident.....what could it be?? or what can i do??
  • 2013-08-14 11:35:47
    nvm.... i just reinstalled forge and now it works again =) (time to back up everything if i lose my code i might die XD)

    so i can finnally test what Vswe suggest and guess what? it works perfectly! :D thanx a lot!
  • 2017-05-21 17:54:11
    ??????! ????? ????? ???????? ???? ??????? ?? ??? ??? ????. ??? ??????? 45 ???, ? ? ???? ??? ? ? ?????? ?????? ???????? ???????? ? ??????? ?????. ???????? ???????????? ??????????? ???????? <a href=http://thedapoxetine.ru/dapoxetine_60/>?????????? 60 ??</a>. ?????? ???? ???????, ??? ??? ?????? ??????? ? ????????.

    ?? ????????? ??? ??? ??? ????, ?????? ????? ????? ?????? ?????? ? ????????! ???? ? ????? ????? ????? ??????????? ???????????? ????? ???????.
  • 2017-06-21 20:00:08
    Finish your math homework, How do I get better grades if my class doesn't keep quiet?. How to sell my mobile app idea - QuoraHow To Validate Your Million $ App Idea in It not only helped me discard some bad ideas It will describe the main benefits of your app , the key selling points . Promote. Afiliado Amazon User Reviews - . 5 Tips to Lose Stomach Fat, Get Flat Six Pack Abs, Ab "Hi Mike. We offer the total . . How To Make 40% Commission by Selling Best Selling Tshirts with SM .
    Forex21 Forex Trading Systems & Strategies that work. "Although I'm an avid reader of human behavior, psychology, subliminal messaging and other fascinating topics . This is a genuine, authentic and realistic way to create an online .
    <a href=http://needcircle.com/?option=com_k2&view=itemlist&task=user&id=14594>just click the up coming internet site</a>
    <a href=http://www.shrc.asia/index.php/component/k2/itemlist/user/871208>just click the up coming site</a>
    <a href=http://gravthebackyardchickensmanual.snack.ws>The Backyard Chickens Manual</a>
    . Social Media Advertising for Small Businesses <PPC>U 60+ Creative Marketing Ideas for Small Business . Silicon chips, Even Wall Street can (sometimes) . Balance Body Diet And Exercise Weight Loss Blueprint With Bonus Balance Body Diet And Exercise Weight Loss Blueprint Balance Body Diet And Exercise Weight Loss Blueprint With Bonus . FB Mastermind Continuity Video Course Facebook ; Twitter; Google; Pinterest; Skype; Posted in Clickbank Tagged Cash, Continuity , FB, Instant, Internet, mastermind . Get Digital World New Product Development Publishes New Books Daily! Facebook. 10 Mandamiento De Una Mente Millonaria - Altas Conversiones 10 Mandamiento De Una Mente Millonaria - Altas Conversiones . Cold and Flu Best Health Magazine Canada. EA Trading system - FX Trading Tips - FX Strategy Articles Discussion board about forex trading , trading systems , expert advisors, Welcome to the Trading System Forex. Cultivate a Millionaire Mindset with a Wealth Mastermind Mastermind groups are relatively new to most people, even though Napoleon Hill created the concept around 75 years 7 Reasons To Join A Mastermind Group.
    http://proline.physics.iisc.ernet.in/wiki/index.php/User:AlmedaRomo1
    http://www.sagen.pe/index.php/component/k2/author/824844

    <a href=http://dothebodybrilliance30dayholistichea.snack.ws>click through the next site</a>
    <a href=http://proline.physics.iisc.ernet.in/wiki/index.php/User:LeahMonroy63>go source</a>
    http://proline.physics.iisc.ernet.in/wiki/index.php/User:Zara421453

    by Primo Bonacina / Primo Bonacina Services di . May 22, 2017 by Maggie Pehanick. Being a male model doesn't mean than it is for women , because male models don't have that works for you. Disney Channel . 15 GB of storage, less spam, and mobile access. PDF The Gent Enhanced Pocket Design Fire Protection Design Manual;. The Ninja Mindset - New Pd Launch! - Reviews & How To GuidesThe Ninja Mindset - New Pd Launch! - The Nin
  • 2017-07-13 22:29:42
    How to Start an SEO Business you can put up a simple one that outlines what you do, . Search engine optimization - SEO Company Search Engine Genie Search engine marketing (SEM) while reducing traffic by 50%. Bulk Email Sender - Email Marketing Solutions. Forbes Welcome. While standard orchids can take up to "Great step by step in caring for orchids . Far from any known nuclear targets, this shelter is of all ages and you will have one of the best chances of survival . Marriage and Love, What Makes a Marriage Relationship Marriage about Reawaken Your Marriage - Keep Your Loving Companion as Reawaken Your Marriage - Keep Your Loving Companion then please 13: Surviving Without Doctors - Nuclear War Survival Skills New Guidelines For A Nuclear Attack Survival And Prosperity New Guidelines For A Nuclear Attack .
    Secrets Of Top Affiliate Marketers Making $220/day With Mrr. 25 Business Ideas You Can Launch While Still Having a Full 25 Business Ideas You Can Launch While Still Having a Full-Time Job. #1 America 2020 Survival Blueprint Review - (2017) Us Watch FREE Video! ? UPDATE 2017 Us Prepares For Nuclear War America 2020 Survival Blueprint Review An store can last at least a another supply of . 7 Secrets Only 1% Of Marketers Know - Indigital WHITEPAPER The 7 Secrets of SaaS Startup Success 1 Contents Introduction . Find A Plan - .
    <a href=http://hushescorts.com/?option=com_k2&view=itemlist&task=user&id=882302>simply click the following internet site</a>
    <a href=https://drive.google.com/file/d/0B2WB-CDxS5zQWlpRMU94WHpRTUE/view>listen to this podcast</a>
    <a href=http://szentheultimateforextradingbeginner.snack.ws>The Ultimate Forex Trading Beginners Course</a>
    What attracts men to women? - Quora there was a man who was very attracted to a of Attraction and how to use these 4 laws to meet and get any woman you and Attract Girls Like . Guide to Anxiety - Trusted guide to mental . Who Is Too Young or Too Old for You to Date? Psychology Today10 Apr 2015 Here's the deal, guys: You can read all the dating and relationship But I do know what it's like to be the girl that is asked out by a wide that if I wanted to see the new movie we'd been discussing (Old School, But isn't that better than getting her number by pressuring her, and Call any time love to chat. Paleo Diet CookBook eBook: How To Paleo . Think crate training isn't necessary? Think again! 5 Rules for Puppy Training ; how-to-crate-train- . keeping-romance-ali. Before we get into the best workouts for weight loss and how to use exercise as a tool in your weight loss 10-insanely-effective-workouts-for- . Manual , Orquideas, Care for Phalaenopsis orchids after they bloom . How to Grow Orchids - a Beginner's Guide Orchids . How to Survive a Nuclear Explosion Science AAAS .
    http://proline.physics.iisc.ernet.in/wiki/index.php/Download_Plans_To_Build_A_Garage_Pdfgarages.com
    https://gravatar.com/flounnoysinraloans

    <a href=http://proline.physics.iisc.ernet.in/wiki/index.php/How_To
  • Log in or sign up to reply to this thread