Started by
_Vitjok_
on
Topic category: Help with Minecraft modding (Java Edition)
Hello, people, please, can help me?
The problem is that: when I use event "Spawn entity", MCreator spawns an mob, who's do nothing. In older version MCreator do this too, but it spawns 2 bosses, one is glitchs, but second is normal boss..
Please, people, can I summon the boss without this glitches?
I already used "Execute command" & command /summon boss ~2 ~2 ~2, but the chat says: "I dosn't have permission"..
Anyone, know how I can do this?
You must spawn it server-side only , so put before the spawn code: if(!world.isRemote){
@#1 Can I spawn without this code? I want to play in singleplayer too
@#1.1 It will be still playable on singleplayer. Becasue singleplayer in minecraft is defacto "server" and "client" at same time.
@#1.1.1 *Because
@#1.1.1 Oh, I don't know what I need to do code, I have an crash..
So, how I need to do it? Can I have an screenshot maybe? (In script I zero)
And, if you need, there error:
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: illegal start of expression
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: illegal start of expression
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: ';' expected
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: ';' expected
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: not a statement
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: ';' expected
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: <identifier> expected
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: not a statement
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:165: error: ';' expected
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4)
^
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:173: error: reached end of file while parsing
}}
^
10 errors
@#1.1.1.1 Oh.. I think I can't get help, yeah? :\
@#1.1.1.2 As nuparu said you have to insert the code if(!world.isRemote){ before the spawning code and close with another bracket.
Example:
if(true){
Entity sentity = EntityList.createEntityByName("Witherstorm", world);if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);if(!world.isRemote){world.spawnEntityInWorld(sentity);}((EntityLiving)sentity).playLivingSound();}
}
@#1.1.1.2.1 thanks for your message, but please, tell me, after this event "Custom code" what I need to use? Execute command, or spawn entity? I change your "Witherstorm" to my mob and, use execute command, the same result and spawn entity too. I think I really stupid, but really can't understant, so, sorry D:
You must change the code of the whole element. In the workspace is button "View source":
There find line that looks like this: world.spawnEntityInWorld(sentity);
Before it put : if(!world.isRemote){
and after it put }
@#2 Maybe I really stupid, but it dosn't works..Can I have screenshot, where you do this in source editor? (Damn, I really bad at this D:)
I decided to make a video.
@#3 Um, have build fail
C:\Pylo\MCreator165\forge\build\sources\main\java\mod\mcreator\mcreator_spawnHeavenGuardian.java:98: error: class, interface, or enum expected
if(!world.isRemote)public class mcreator_spawnHeavenGuardian{
^
1 error
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
BUILD FAILED
@#3 Woops, my error, everything is okay, thanks!
@#3 Uh, now the item dosn't spawn anything.. I have an item, who spawn the boss, they spawn ghost, after this code what I do, the item dosn't work.. Maybe I do something false, but test the code:
if(true){
Entity sentity = EntityList.createEntityByName("guardian", world);if (sentity != null){sentity.setLocationAndAngles(i+3, j+3, k+3, world.rand.nextFloat() * 360F, 0.0F);if(!world.isRemote){world.spawnEntityInWorld(sentity);}((EntityLiving)sentity).playLivingSound();}
}