#Make an item that is immune to explosions/fire, and can't despawn
23 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
bump
bump
bump
What kind of immune?
You mean, like netherite tools immune to fire?
Like netherite tools immune to fire
Like nether star isn't destroyed by explosions
And also can't despawn
const InvulnerableItem = Item.of("minecraft:diamond_block")
EntityEvents.spawned("item", event=>{
let {entity, entity:{item}} = event
console.log(entity.nbt)
if(item != InvulnerableItem) return
entity.mergeNbt({Age:-32768})
entity.setInvulnerable(true)
})
This makes dropped diamond_blocks never despawn and invulnerable to all kind of damage.
Oh, yeah, it should be placed in server script
Fire resistance can be added through item registry but I don't find the despawn part and explosion immune part.
Sorry for long answer, thanks for your help, but I checked the script, it looks like Invulnerable makes it not burn in fire, but it stll can be destroyed by an explosion
It survived several tnt explosion in my test. What explosion did you use?
just tnt explosions
No, it wasn't around sadly, it was just destroyed
Eehh, I just "fixed" it by making a pneumatic craft explosion crafting recipe with the item crafting itself during the explosion, that works I guess although this is an unsatisfying solution :/
IDK. Maybe it's your pack adding something to an explosion.
perhaps pneumatic just considered everything having no valid recipe crafted into nothing in explosions
Well, nether start is immune to explosions, but maybe PnC accounts for that, and that's actually what might be happening
Anyway, thanks for the help, ig I'll stick with the recursive explosion recipe since this works lol
Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue!
This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.
Do you have any other questions regarding your issue? Feel free to ask!
Note: You should create a new post for unrelated issues.
damn wrong one