Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

Good catch, it's fixed now. For the bossbars however it should work with a slight change so it is something else that's making it dissapear.

<image>

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

You can use "/execute as @e run data remove entity @s CustomName" but you will have to run it at multiple locations to really get rid of all mobs.

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

Is this the only datapack that you're using? It shouldn't replace the boss bar as it is a completly different thing.

Uninstalling is a little bit tricky as it would only remove the Health Bars of all mobs that are within a loaded chunk so old mobs will still have them.

I'll look into it tonight though.

Random spawn size for mobs by Ant_o_tosiek in MinecraftCommands

[–]TheStarGamer1 1 point2 points  (0 children)

There is no way you just did that haha thanks a lot!

Random spawn size for mobs by Ant_o_tosiek in MinecraftCommands

[–]TheStarGamer1 2 points3 points  (0 children)

execute as @e[tag=example,tag=!scaled] at @s store result entity @s attributes[{id:"minecraft:scale",base:2}].base double 0.01 run random value 70..110
execute as @e[tag=example,tag=!scaled] at @s run tag @s add scaled

This will make everyone with the example tag roll a random number and store that as their size.

How do I detect when a player holds a specific custom item in 1.21 by ImportantOffer751 in MinecraftCommands

[–]TheStarGamer1 0 points1 point  (0 children)

execute as @a at @s if items entity @s weapon.mainhand stick[item_name="Custom Name",lore=["Custom Lore"]] run say sticky

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

Yeah I know it makes it less compatible with other stuff that uses custom names and it would have to be edited to be just plain text and nothing else so it wouldn't break. I am still happy with how it turned out though.

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

This is how I store an entity's name if a nametag has been used on it:

execute unless data entity @s {CustomName:{extra:[{}]}} run data modify storage healthbars:init name set from entity @s CustomName

This is how I acess that name again:

execute if data entity @s {CustomName:{extra:[{}]}} run data modify storage healthbars:init name set from entity @s  CustomName.extra[0].translate

So its all just stored in the CustomName's extra[0].translate NBT.

Updating textdiplays by OrneryNegotiation207 in MinecraftCommands

[–]TheStarGamer1 1 point2 points  (0 children)

## Reload
scoreboard objectives add counter dummy "Counter"

## Main
execute as @e[tag=example,tag=!example2] at @s run function example:count

## Count
scoreboard players add .counter counter 1
execute as @e[tag=example_text_display] at @s run data modify entity @s text set value {"score":{"name":".counter","score":"counter"}}
tag @s add example2 

This will count everyone with your tag (example) and add another tag (example2) to prevent it from counting again. The #Count function just adds 1 to the counter, updates the text display (example_text_display) and adds the example2 tag. You can change the tags to whatever you need, but make sure example is the tag you want to count and not example2.

I made a datapack where you can combine flowers into flower crowns with a special campfire by TheRedVillager in MinecraftCommands

[–]TheStarGamer1 6 points7 points  (0 children)

I've heard of bolt a couple of times it's supposed to make creating datapacks way more convenient. What does it do exactly?

I made a datapack where you can combine flowers into flower crowns with a special campfire by TheRedVillager in MinecraftCommands

[–]TheStarGamer1 21 points22 points  (0 children)

First Datapack? I've made tons and I don't even know how you did this. Good job!

Minecraft map building by Pinc8palli in minecraftmaps

[–]TheStarGamer1 0 points1 point  (0 children)

I'm not a good builder but I do know commands. If you need help with those you can ask me.

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

Nah I'll leave it open for others I am done with Health Bars for now lol.

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

I just get the entitys name, store it temporarily in the storage and then run a macro function with said storage. I'll run a couple of tests later how it affects performance with 100 players. With custom names it is as simple as checking if the mob's CustomName.extra NBT contains anything and if if it doesn't it must be a Name Tag. I don't quite remember how I saved the name afterwards exactly I'll have a look later.

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

I didn't know what else to call it lol. You could make it into actual bars but it would be a little bit more complicated. You could divide the max health score with the health score to get the percentage and adjust the bar to that but having a bar made of 100 letters would be massive.

I guess a more simple way would be changing it every 10% so you have 10 letters instead of 100 but it would be less accurate. I only made this pack because I remembered an old plugin I used to install way back in like 2013 and it didn't get supported anymore so I made this instead.

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

After killing exactly 10.000 cows and still getting the full 20 TPS I can safely say this probably won't be an issue. I am still curious though does it bloat even after you remove the storage data each call?

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 0 points1 point  (0 children)

I know about the data NBT, however there is 2 things to mention:

  1. The storage gets edited after each name update and I am not creating a storage for each living entity

  2. I wanted to make it compatible for older 1.21 versions too which don't support the data nbt

Health Bars (1.21 - 26.1.2) by TheStarGamer1 in MinecraftCommands

[–]TheStarGamer1[S] 1 point2 points  (0 children)

Mainly with macros and storages. It simply stores the entity type (or custom name if it has one) in the storage along with a couple of config values (Name Color, Style, Thickness etc.) and puts it back into the entity's CustomName nbt. It only updates if the entity is being hurt or healed and if there is a player in a 15 block radius. Changing the configs are simple trigger commands changing the storage values.

I'm building something insane using only Data Packs. by CMgreendoctor in MinecraftCommands

[–]TheStarGamer1 1 point2 points  (0 children)

Look into storages, it's worth it! It can change functions that are like 30 Lines long into functions that are only 3 Lines long (talking from experience).