Jump to content

[1.7.10] Spawn Entity Infront Of Player On Item Right-Click


Recommended Posts

Posted

what the title said

Be more specific. Do you want everyone reading to spawn an entity in front of the player on item right click?

 

If you mean a projectile, say so. If you mean a <? extends EntityLivingBase> then say so.

Posted
    public static Vec3 getPointUsingAnglesRange(Vec3 start, float yaw, float pitch, float range){
        double coordX = start.xCoord + (double) (-MathHelper.sin(yaw / 180.0F * (float) Math.PI) * MathHelper.cos(pitch / 180.0F * (float) Math.PI) * range);
        double coordY = start.yCoord + (double) (-MathHelper.sin(pitch / 180.0F * (float) Math.PI) * range);
        double coordZ = start.zCoord + (double) (MathHelper.cos(yaw / 180.0F * (float) Math.PI) * MathHelper.cos(pitch / 180.0F * (float) Math.PI) * range);
        return Vec3.createVectorHelper(coordX, coordY, coordZ);
    }

Posted

I believe what they may be looking for is something that I was just talking about yesterday. You use and item to right click the ground and like magic a entity appears in front of ya. What I don't know is if it is suppose to be a custom entity or if you want a zombie, or if the entity is a creature, or something like a painting. I do know that VSWE has a video tutorial for that if you want a custom entity in this case its a spaceship. It's for 1.6 but the porting isn't hard. The one thing I got stumped on was MultiMote suggested instead of doing something like.

ship.posX = 0.5;
ship.posY = 1.5;
ship.posZ = 0.5;

 

do:

 

ship.setLocationAndAngles(x + 0.5, y + 1.5, z + 0.5, 0, 0);

 

Again though that's for a spaceship not a mob. Don't know what you are looking for when you say just entity.

 

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.