Started by
Inusitatus
on
Topic category: Help with Minecraft modding (Java Edition)
Ive been trying so hard to make a mob that attacks only at night.
package net.mcreator.scpmod.procedures;
/* imports omitted */
public class IsNotDayProcedure {
public static boolean execute(LevelAccessor world) {
if (world.dayTime() > 12500 && world.dayTime() < 23000) {
return true;
}
return false;
}
}
This code (actually code blocks, but i just copied the code in the generated code viewer) is referenced in the attack player ai task condition. It will never attack. Please help, this was my last resort.
Edited by Inusitatus on Wed, 12/13/2023 - 21:35
Make two mobs, one that attacks, and one that doesn't. Make the none attacking one spawn, and check if it is night. If it is, get rid of the first one, and spawn the attacking one.
OOOOhhh, i like that idea. I am trying to make a scp 3008 type deal (using the create mod and valkyrian skyes so i can move stuff around) , and that will work great, since i couldnt figure out ow to make him be quiet, this will work so well(i hope), thanks!!!
Well, ive messed aroound a bit, and i cant seem to get it to work. can you please provide more details?
Sure! What doesn't work?
ok, so, i got it to work, almost. unfortunately it spawns around twenty of its counterpart, and i cant find anything to make it only trigger once.
Could you show me the procedure for switching? I could help you use a variable for it.
Yeah, i tried some variable stuff, to no avail.
https://app.gemoo.com/share/image-annotation/593950251567693824?codeId=vJROajZEYojB9&origin=imageurlgenerator&card=593950250431037440
I am used to game development using gdevelop, and pretty new at this, so please excuse anything that makes me look like an idiot, lol.
I think I know a way to fix it, give me like a day and I'll send a screenshot.
Any luck so far?