Started by
MrAppleSalad
on
Topic category: Troubleshooting, bugs, and solutions
I created a dimention where a small explosion goes off when you enter it, destroying the portal and stranding you there until you can build a new one. The problom is that I did this with elements and the explosion also goes off whenever I re-log into the world, it's really annoying. Is there any way to fix this?
On the same topic of dimensions I'm also having trouble making it so only my custom mobs spawn. Despite there being nor grass mobs like chickens and sheep still spawn all over the place. Is there any way to prevent this? I would also like to make it so other hostile mobs like zombies and skeletons don't spawn if possible.
Make a variable for this. The variable will turn from 0 to 1 when you enter the dimension. While the variable is at 0, and you enter the dimension, the explosion will take place (Make sure to put this code BEFORE the block that turns the variable from 0 to 1).
Assuming this is a global world variable, it will save this when you close the game. This lets you enter the dimension multiple times, but it only strands you there the first time.
Here's roughly what the block code would look like:
If (enteredDimension = 0) (
explode
set (enteredDimension) to 1
}
Hopefully this helps!
The mob solution is really simple. Make a biome, set it so that only the mobs you want spawn in said biome, and then put that biome in your dimension.
hey, so the mob spawning thing worked like a charm! i can't quite figure out the explosion one though, how do you make custom variables using the code block things?
To make the variable, go to the global variables tab on the side, create a global world variable that is a number.
After that, go into the procedure element. Find the custom variables tab in there. Attach this code to the procedure, and it should work. Note that teleportDimension variable is for my mod. It's for a teleporter block. You can name the variable whatever you want.
The variable should be set to 1, not 0 after the explode. that was my mistake there.
That worked! Thank you! :D
hey, one more thing before i leave you alone since you're being really helpful, do you know if there's a way to get rid of the portal trigger item only if it is used to make the portal? i made it get rid of the item when it is "used" but that now happens whenever it is right clicked on anything.
I'm not sure about this one, actually. Sorry.
What you could do is make check if it's right clicking on the Portal frame block. So that if it's not it won't delete it.
thanks! it's not perfect (as now it goes away when right clicking any instance of the block portal or not) but it will do.
that's alright, thank you tho!