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

Spawn entity in player position


patatis
 Share

Recommended Posts

Use World#addEntity. Make sure to use EntityType#create, not the class constructor. You can then use Entity#setPosition (or similar).

In future please try looking at the vanilla code first, it’s very helpful (you are modding their game) and you could have answered this question yourself by looking at any vanilla code that spawns an entity.

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

5 hours ago, Cadiboo said:

Use World#addEntity. Make sure to use EntityType#create, not the class constructor. You can then use Entity#setPosition (or similar).

In future please try looking at the vanilla code first, it’s very helpful (you are modding their game) and you could have answered this question yourself by looking at any vanilla code that spawns an entity.

Thank you for your response, but im fairly new in Minecraft modding and I dont have a ton for resources, if you could send me the vanilla example as you said so I dont have to ask more it would be very useful!

Link to comment
Share on other sites

8 minutes ago, patatis said:

if you could send me the vanilla example as you said so I dont have to ask more it would be very useful!

Look under Referenced/External Libraries in your IDE.

Here's what it looks like in IntelliJ:

1722010093_ScreenShot2020-02-06at12_10_53am.thumb.png.54c0f967fb1bd5527b86634d86aadcba.png

  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

The very first library...

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.

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