Posted February 5, 20205 yr I am trying to spawn a vanilla entity on the players position when a custom event triggers, but my world variable dosnt have the spawnEntityInWorld(), I dont know what I am doing wrong.
February 5, 20205 yr 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 February 5, 20205 yr by Cadiboo About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.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)
February 5, 20205 yr Author 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!
February 5, 20205 yr 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: About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.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)
February 7, 20205 yr The very first library... About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.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)
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.