1
Light-emitting Entities
In my Data Pack, I am making it so Glow Squids actually give off light, and so do Players with the Glowing effect.
I was thinking of doing this by repeatedly placing a Light block at their position, but this ended up just leaving a trail of Light blocks.
If someone could make a single function/command that would accomplish this, that would be great!
Any help would be greatly appreciated!
I was thinking of doing this by repeatedly placing a Light block at their position, but this ended up just leaving a trail of Light blocks.
If someone could make a single function/command that would accomplish this, that would be great!
Any help would be greatly appreciated!
Create an account or sign in to comment.
9
1
Summon a marker on the squid that spawns a lightblock at its location, tag the marker with whatever block it is inside of (e.g. air, water, waterlogged kelp). When the squid moves away, replace that lightblock in the marker with whatever you tagged the marker with and then delete that marker.
Restart that process
Restart that process
1
What's a marker? Could you maybe provide the commands I would use?
1
Actually change of plan. This will only work for water and air as light is a physical block with a hitbox. It will get destroyed by falling blocks and will replace blocks that have existed.
if you want the light blocks to appear in waterlogged translucent blocks such as kelp, you will need to code for that.
I will be making a very simple one for only water.
https://minecraft.fandom.com/wiki/Marker
Tag marker w/ /tag with whatever block the marker is on.
IN namespace:summon light:
IN namespace:main OR namespace:scheduled_function_that_checks_for_squid
END
IN namespace:remove_self
END
if you want the light blocks to appear in waterlogged translucent blocks such as kelp, you will need to code for that.
I will be making a very simple one for only water.
https://minecraft.fandom.com/wiki/Marker
Tag marker w/ /tag with whatever block the marker is on.
execute as @e[type=marker, tag=lightblockSpawn] at @s run function namespace:summon_light
IN namespace:summon light:
tag @s remove lightblockSpawn
execute if block ~ ~ ~ water run setblock ~ ~ ~ light[waterlogged=true] replace
tag @s add light_spawned
ENDIN namespace:main OR namespace:scheduled_function_that_checks_for_squid
execute as @e[type=marker,tag=light_spawned] at @s unless entity @e[type=glow_squid,distance=..2] run function namespace:remove_self
//distance is 2 for testing, but 1 should doEND
IN namespace:remove_self
setblock ~ ~ ~ water replace
kill @s
END
1
I'm sorry, but I don't really understand this. What command would i use to summon the marker at a specific point with the specific tag?
If you could, would you be able to provide functions for the Glow Squid and Player parts?
If you could, would you be able to provide functions for the Glow Squid and Player parts?
1
execute as @a[<diamond helm nbt>] at @s unless entity @e[type=marker,tag=light_spawned,distance=..2] run summon marker ~ ~ ~ {Tags:["lightblockSpawn"]}
change the 1st selector to whatever entity ytou want glowing
1
I think I understand this, but how would I do this, but for players with the Glowing effect?
1
Are you talking about players or squids?
If its the latter, it would be unrealstic to give them the glowing effect as you can see the outline through walls
If its the latter, it would be unrealstic to give them the glowing effect as you can see the outline through walls
1
I am talking about Players, since I forgot to mention that I changed my mind about how players give off light, and they would only do this if they are wearing a custom Miner Helmet item in my data pack. So how could i do the same thing i would do with the glow squid, but for players wearing a diamond helmet?
P.S, the diamond helmet is just for testing to see if this works
P.S, the diamond helmet is just for testing to see if this works
view more replies ( 1 )