Last active
August 15, 2020 13:27
-
-
Save tombailey/94461b24d70452f989cb92b4c0a28ab1 to your computer and use it in GitHub Desktop.
An example BDSX (https://github.com/karikera/bdsx) mod which despawns TNT entities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <reference types="minecraft-scripting-types-server" /> | |
| import NoTnt from './notnt'; | |
| const system = server.registerSystem(0, 0); | |
| NoTnt.init(system); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <reference types="minecraft-scripting-types-server" /> | |
| export default { | |
| init: (system) => { | |
| system.listenForEvent(ReceiveFromMinecraftServer.EntityCreated, event => { | |
| const entity = event.data.entity; | |
| if (entity.__identifier__ == "minecraft:tnt") { | |
| system.destroyEntity(entity); | |
| } | |
| }); | |
| console.log("No TNT explosions script is active"); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment