So I was thinking about first how can an item be destroyed? Inside GUI? It cant. You have to drop it out. So if it disappears after dropped out you could check if its at any player's inventory but I have no idea how to do it and I'm 99% sure there is a better solution.
I would also like to know if its possible to print a text containing a variable.
Lets say:
playerHead .. " has died permanently. ( Head Destroyed )"
#Is it possible to detect if a specific item has been destroyed?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
Someone will come and help soon!
💬 While you wait, take this time to provide more context and details.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
<@&1166082198152159386> <@&1202694677766348840>
🙇 Helpers Arise!
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
You can use the durability_changed advancement to check if an item breaks
for items on the ground, you could check if like this execute as @e[type=item] if data entity @s {Age:5999s} run say I DED
there could be a very slight possibility that it fails if a player picks it up in the last tick
I'm sorry I have worded it really bad... I mean an item gets destroyed.
Like it despawns, gets thrown into cactus or lava.
for despawn that's what I just sent, for cactus and lava you cannot reliably and accurately detect that
the only thing you can do for cactus and lava is to check the blocks in a vey small radius around the item and hope that it doesn't get picked up before it is destroyed
Oof... Well honestly the only thing I wanted to do is that when a player dies "forever" he drops his head. And with the revive beacon which is almost done can be revived. But what if someone destroys someone's head. So I was thinking of printing a message because killing someone forerever should be either impossible or be notified. So what would you do?
Maybe with context you could provide some better and more possible solution.
You can give the item a special nbt so that you can detect that in entity form and make it invulnerable.
That makes them not able to be destroyed by lava and cactus
for void you can give it levitation
you can make it immune to despawn by setting its age to a very high negative number
OHH. That sounds really good actually. Can you get its cordinates? So like can you get the cordinates of that item? Cuz then it could be detected if y is bellow -64 and then just give it levitation for idk 3 seconds. And then it could be done.
execute as @e[type=item] if items entity @s contents *[custom_data~{revive_item:true}] at @s if predicate {"condition":"minecraft:location_check","predicate":{"position":{"y":{"min":-64}}}} run effect give @s levitation 3 1
I never seen something like this so far. Wow...
That is a very unusual syntax but I think I understand... I mean I said the same about macros and I'd say its about now when I feel like I can kinda use them.
the unusual syntax you mean is probably the inlined predicate
you don't have to put them in seperate files (same with item modifiers/loot tables/etc..)
Yeah.
I would have imagined something more... codelike. I mean I'm more used to just saying: Position.y < -64
or something so this is kinda throwing me off 
for short predicates that I only use once I just inline them
yeah, mcf is not like your traditional programming, it is a language of workarounds and abyssmaly long one liners
Although the workaround part was a lot worse in the past
Well thanks for the help. I have 1 last question this is out of lazyness but what is the data in player's called that says their username? I wanna make a player_head where they are its skull owner. So then the item itself would store the username so instead of customdata the data would be inside it.
the player doesn't store its name
you can only get it by dropping a player head whith a loot table that is filled with the player that dropped it from it's profile.name nbt
That sounds like an abysmal workaround... 
Ok so I only used loot-tables to make blocks dont drop in a custom dimension so I would like to ask you how do I even use them? Do I add loot-tables to the player? Or... ( Sorry )
I think this will work
Idk if mc ignores this loot table or applies it
I never tried it
there does exist a file in the original files (it's empty)
so should work
And how do II use it or test it? Cuz the other issue is that it should only trigger when its their last life. But then I could just delete that item if its not so it could stay.
Damn I hate theese workarounds. Mojang why?
you can have a score check in the loot table to only make it drop if their life score is 0
Oh. But it only decreases after they die from the player_killed advancement.
And I'm not sure if it runs on the same tick.
loot tables come after advancements and functions in the process sequence afaik
advancements are triggered immediately so this all should work
Eh. Imma try then.
Sorry for hitting you with questions constantly. I just wanna learn the reasons too not just the solutions and later on I wanna be able to work on my datapacks without being a burden lol.
np, thats the purpose of dph. Not just giving the answer but teaching how it works.
Also sorry for also asking but is it possible to delete saved recipes from an entity or disable it?
Its so annyoing to read trough player data and 80% of the data is just recipes.
/recipe take @s *
I have never noticed this command 😭
Could you send me the github link to the vanilla datapack pls?
I forgot what is the link...
So I can search up the player loot_table
And then use the top left drop-down to switch to the data branch
-# or this https://github.com/misode/mcmeta/tree/data if you can’t figure out how to switch branches
Thx.
{
"type": "minecraft:entity",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:player_head",
"functions": [
{
"function": "minecraft:fill_player_head",
"entity": "this"
}
]
}
],
"conditions": [
{
"condition": "minecraft:entity_scores",
"entity": "this",
"scores": {
"maxHealth": 0
}
}
]
}
],
"random_sequence": "minecraft:entities/player"
}
For now I'll set this as done.