Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

help with xp


GodOfYeti
 Share

Recommended Posts

Now here is a step by step tutorial of making such custom entity.

First, think of what your entity should be called in the code.

It can be like EntityCustomXPOrb or something you wish.

Second, when making (public class "Name"), be sure it extends (extends EntityXPOrb) so that you can have everything in (EntityXPOrb) ready for your usage.

And because you inherit from a pre-defined class (or you can say it is vanilla) you can skip the annoying stuff about update movements, renders, textures, and eventually what the xp orb should do with the player.

Third, make constructor "Name"(World world, double x, double y, double z, int xp), then add super(world, x, y, z, xp) to tell Forge / Minecraft you now have a new entity which is similar to those in vanilla Minecraft, and tell Minecraft to make a new EntityXPOrb based on your values.

Finally, call world.spawnEntityInWorld(new "Name"(this.worldObj, x, y, z, xp)); when you want to spawn your entity.

 

I hope this helps.

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
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.

 Share



×
×
  • Create New...

Important Information

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