Stop item from being destroyed

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

gingerandcoco

Member
Oct 22, 2025
2
0
1
I am making a plugin for an SMP with custom shards that give potion effects, and I was wondering if it is possible to make it so the items cannot be destroyed in any way (lava, fire, cactus, explosions, etc)? I've already made it so the items can't despawn. Thanks
 
If you hava Skbee. You can use like this:

```
import:
org.bukkit.entity.EntityType
on entity removed from world:
event-entity remove cause is death..... EXPLODE or more...(change it as you want)
event.getEntityType() is EntityType.ITEM
cancel event
```

If you don't have Skbee use this:

```
import:
org.bukkit.entity.EntityType
org.bukkit.event.entity.EntityRemoveEvent
org.bukkit.event.entity.EntityRemoveEvent.Cause

on EntityRemoveEvent:
event.getEntityType() is EntityType.ITEM
event.getCause() = Cause.DEATH. ...... EXPLODE or more...(change it as you want)
cancel event
```

more info see
 
I'm not sure if I'm just being a bit dumb, but I tried the second one you sent (without SkBee) and it is giving me this error:

[10:47:23 INFO]: [Skript] Reloading nodestroy.sk...
[10:47:23 INFO]: Line 1: (nodestroy.sk)
[10:47:23 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[10:47:23 INFO]: Line: import:
[10:47:23 INFO]:
[10:47:23 INFO]: Line 6: (nodestroy.sk)
[10:47:23 INFO]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
[10:47:23 INFO]: Line: on EntityRemoveEvent:
[10:47:23 INFO]:
[10:47:23 INFO]: Line 1: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: import
[10:47:23 INFO]: Line: import:
[10:47:23 INFO]:
[10:47:23 INFO]: Line 2: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: org.bukkit.entity.EntityType
[10:47:23 INFO]: Line: org.bukkit.entity.EntityType
[10:47:23 INFO]:
[10:47:23 INFO]: Line 3: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: org.bukkit.event.entity.EntityRemoveEvent
[10:47:23 INFO]: Line: org.bukkit.event.entity.EntityRemoveEvent
[10:47:23 INFO]:
[10:47:23 INFO]: Line 4: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: org.bukkit.event.entity.EntityRemoveEvent.Cause
[10:47:23 INFO]: Line: org.bukkit.event.entity.EntityRemoveEvent.Cause
[10:47:23 INFO]:
[10:47:23 INFO]: Line 6: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: on EntityRemoveEvent
[10:47:23 INFO]: Line: on EntityRemoveEvent:
[10:47:23 INFO]:
[10:47:23 INFO]: Line 7: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: event.getEntityType() is EntityType.ITEM
[10:47:23 INFO]: Line: event.getEntityType() is EntityType.ITEM
[10:47:23 INFO]:
[10:47:23 INFO]: Line 8: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: event.getCause() = Cause.DEATH.EXPLODE
[10:47:23 INFO]: Line: event.getCause() = Cause.DEATH.EXPLODE
[10:47:23 INFO]:
[10:47:23 INFO]: Line 9: (nodestroy.sk)
[10:47:23 INFO]: Can't understand this structure: cancel event
[10:47:23 INFO]: Line: cancel event
[10:47:23 INFO]:
[10:47:23 INFO]: Encountered 8 errors while reloading nodestroy.sk! (11ms)