Jump to content

[1.7.10]I can't remove entity.


zlappedx3

Recommended Posts

I write this code for spawn entity.

 

ICommandSender is p_71515_1_

                    World world = p_71515_1_.getEntityWorld();
                    EntityTower entity1 = new EntityTower(p_71515_1_.getEntityWorld());
                    entity1.setPosition(i + 0.5D, j+1, k + 0.5D);
                    world.spawnEntityInWorld(entity1);

 

top code can spawn it but bottom code can't remove it.

                    World world = p_71515_1_.getEntityWorld();
                    EntityTower entity1 = new EntityTower(p_71515_1_.getEntityWorld());
                    entity1.setPosition(i + 0.5D, j+1, k + 0.5D);
                    world.removeEntity(entity1);

 

I want how to do ?

Link to comment
Share on other sites

                    World world = p_71515_1_.getEntityWorld();
                    EntityTower entity1 = new EntityTower(p_71515_1_.getEntityWorld());
                    entity1.setPosition(i + 0.5D, j+1, k + 0.5D);
                    entity1.setDead();

 

give me call it ?

Link to comment
Share on other sites

I need Kill entity tower positino x y z by entity1.setPosition(i, j+1, k); by EntityTower entity1 = new EntityTower(p_71515_1_.getEntityWorld());

 

but it can't dead.

 

                    World world = p_71515_1_.getEntityWorld();
                    EntityTower entity1 = new EntityTower(world);
                    entity1.setPosition(i, j+1, k);
                    entity1.setDead();

Link to comment
Share on other sites

zlapped, just call this: "p_71515_1_.setDead();" Like replace all of the world, and set position, and new entitytower stuff, with just  "p_71515_1_.setDead();"

That would kill the player. No.

 

Ah, I misunderstood. Well, in that case, pretty much the only easy way I can think of is storing the towers created via command in a serverside array, then having some way for the player to reference that array when choosing which tower to delete. Another option is simply deleting the nearest tower to the commandsender, I guess. How to explain that to zlapped is another matter entirely, unfortunately.

Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help!  http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/

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.

Announcements



×
×
  • Create New...

Important Information

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