Started by
LaTortiia
on
Topic category: Help with modding (Java Edition)
Hey! So I've been wondering if any of you knows how to code a sphere using either MCreator Procedures or Minecraft Commands.
My goal is to make a sphere or air after my nuclear bomb explodes in order to make a crater, but I really don't know how to do it nor have I seen anyone do it, so I don't know if it's even possible to do it.
Has anyone done it? How can it be done?
making a sphere shaped hole requires lots of math. you should google circle/sphere algorithms and try to implement it in your explosion procedure.
i made it using lots of code.
By any means can you send me a screenshot of the code you used?
something like this:
but you'll have to modify it to fit your needs. you'll need to tie it to some object that ticks like an entity.
Undertood, thank you a lot!
I know I'm probably asking too much and being annoying, I don't have much experience with custom code, could you explain me which parameters I should modify in order to make this work please
For example, how to increase/decrease the radius, how, as you said, tie it to a block and how to set it up in general.
You are the very first person I've seen that's able to do a sphere in MCreator so I'd like to get as much info I can on this as possible!
Again, thanks a lot for your help!!!
it would be quite difficult if you don't know how to code.
i would recommend you create a living entity element in mcreator, lock and edit the element code, change the class to extend Entity instead of LivingEntity, remove the unnecessary code that handles entity rendering and living entity methods, implement that piece of code into entity class, override the setLocationAndAngles method to also set the center point at the x, y, z, and set radius the same as rotaionYaw. this way you can just call the "spawn entity with position and rotation" code block in other mcreator procedures to create the explosion.