Posted March 3, 201312 yr Hello! Do you know how to spawn an EntityItem? Basically, I have this Scepter, and I want so that when I right-click it on a diamond block the diamond block disappears and transforms into another Scepter. Sort of like how you make a Thaumonomicon in Thaumcraft. Thanks a lot! Thanks...!
March 3, 201312 yr you just create a new entity and spawn it into the world, example: https://github.com/mnn/jaffas/blob/master/src/minecraft/monnef/core/PlayerHelper.java#L19. do NOT spawn it on the client side. mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
March 3, 201312 yr Author Thank you. Now how do I make it destroy the diamond block and how do I make the main class use PlayerHelper? Thanks! Thanks...!
March 3, 201312 yr it's just my helper class, you'll be fine with this piece of code to make spawning working: Entity entity = new EntityItem(world, x, y, z, itemStackToSpawn); world.spawnEntityInWorld(entity); to handle right click you'll override in the scepter method onItemUse . from its parameters you have all the info needed for spawning an item into the world (don't forget to NOT spawn item on a client side), detecting if it's a diamond block (world.getBlockID) and destroying that block (world.setBlock, block #0 is air ~ nothing). mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.