1

Light-emitting Entities

Drake__archer's Avatar Drake__archer3/6/24 7:04 am
1 emeralds 208 9
3/11/2024 11:34 pm
HoboMaggot's Avatar HoboMaggot
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!
Posted by Drake__archer's Avatar
Drake__archer
Level 10 : Journeyman Modder
9

Create an account or sign in to comment.

9

1
03/06/2024 9:58 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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
1
03/08/2024 7:46 am
Level 10 : Journeyman Modder
Drake__archer
Drake__archer's Avatar
What's a marker? Could you maybe provide the commands I would use?
1
03/08/2024 7:35 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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.
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_spawnedEND


IN 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 do
END

IN namespace:remove_self
setblock ~ ~ ~ water replace
kill @s
END
1
03/11/2024 12:22 pm
Level 10 : Journeyman Modder
Drake__archer
Drake__archer's Avatar
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?
1
03/11/2024 11:34 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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
03/08/2024 8:33 pm
Level 10 : Journeyman Modder
Drake__archer
Drake__archer's Avatar
I think I understand this, but how would I do this, but for players with the Glowing effect?
1
03/08/2024 9:53 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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
1
03/09/2024 6:54 am
Level 10 : Journeyman Modder
Drake__archer
Drake__archer's Avatar
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
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome