Jump to content

How to spawn a mob similar to the Iron Golem?


bl4ckscor3

Recommended Posts

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 :D). 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?

↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑

Link to comment
Share on other sites

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 xD

Link to comment
Share on other sites

"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 xD

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 xD

Link to comment
Share on other sites

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 xD

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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