Started by
gustavowizard123
on
Topic category: Help with Minecraft modding (Java Edition)
so i made a Gas here, from a block not a fluid, i made the gas fly up (each tick delete/place y+1), but i want it to vanish at a Y point, like 25 blocks tall, so the gas dissipate and the game dont go craze with ethernal loops :D
anybody got any idea?
thanks!
Hope this helps
if [ [Y] <= [maxHeight] ] do
[ delete/place y+1 ]
else
[ place [air] at [X Y Z] ]
you probably already fixed this but I would check if the block above is air before changing it so it don't make holes in the roof if gas is in a room.
yeah it does check if its air, so it wont replace solid blocks, i will try this tonight thanks a lot!
the thing is when you set 'If Y = 20' for example, it counts from 0 block position (bedrock), up, so the gas will only work like that from Y = 0 to Y = 20, i will try to set up like Y =150 just to test out, but then the gas would disapear on that altitude... i would need a Y position relative to the current position of block maybe?
A solution idea would be rather than instantly making it disapear at that altitude you could make it have a chance of disapearing.
Or when it goes up there is a chance for it to disapear like a 5% chance (1 in 20).
This is unless you want to use NBT data which might make it a bit more complicated
yeah that is also a idea..
the thing is for example, if the player set up a base on the sky for example, at high 120, you see, the gas will simple wont exist in some Y values then, for now i set it up for Y = 150 until i find anything better
i used NBT number data on a lot of blocks i can handle it to make timers, however, NBT number is also not working for some reason i dont know, was the first thing i tried actually.
also i use a single procedure for 5 different gases, i will also try make a separated one with NBT numbers again
i tried in like 20 ways using NBT number tags... it just wont work, i even tried to apply the variance to the block above it, to be sure... nothing, the gas just climb up and up forever lol
i prb will use your % idea if that dont work
Hi just looked at your code, when you were setting NBT data to the block above it was air since you replaced the block above after you set the NBT.
Simple fix, just move the replace block part to be above the NBT parts.
I'm a bit late to this convo, did you find a way to do it?
lol nope, this one still without solution.