Posted August 10, 201312 yr Hello guys! I'd like to make a new mob and I want it so that you have to put some blocks down in a specific shape and the mob spawns when placing the Pumpkin (Yes, my mob has a pumpkin as a head ). I already looked at several source codes and I searched the vanilla one for solutions but I couldn't find anything. Can you please help me out? http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
August 10, 201312 yr I believe that the code for that is in the pumpkin block. So to do what you wanted. You would need to have your block detect the shape you want via onNeighbourBlock method. I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes. I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there
August 10, 201312 yr Author Thank you so far. But how can I add my Golems to the "Awake-List" without editing BlockPumpkin.java? http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
August 10, 201312 yr "Awake-List"? What do you mean by that? Do you mean how to actually spawn it into the world? Because that's the only thing I can make out of that I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes. I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there
August 10, 201312 yr Author Exactly. http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
August 11, 201312 yr Well that is fairly easy. public void onNeighbourBlockChange(parameters....) { boolean isShape = world.getBlockID(x, y, z); // check all the blocks that you want to be in your shape. if (isShape) { EntityToSpawn entity = new EntityToSpawn(world); entity.setPosition(x, y, z); // something like that world.spawnEntity(entity); } } I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes. I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there
August 11, 201312 yr Author But that is for a custom Block - I'd like it for the vanilla pumpkin. And without editing the base class... http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
August 11, 201312 yr Use PlayerInteractEvent to catch the right click action. Check if player has a block in hand which is a pumpkin...
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.