Skip to content

Instantly share code, notes, and snippets.

@Corosauce
Created January 3, 2019 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Corosauce/251f16e385f744ad53e40d30f96fe3b2 to your computer and use it in GitHub Desktop.
Save Corosauce/251f16e385f744ad53e40d30f96fe3b2 to your computer and use it in GitHub Desktop.
var system = server.registerSystem(0,0);
var gameStaticVars = {};
gameStaticVars.posEntitySpawnStartX = 1063;
gameStaticVars.posEntitySpawnStartY = 64;
gameStaticVars.posEntitySpawnStartZ = -26;
var queryGetAllEntities = {};
var queryGetGameStartEntity = {};
// MINECRAFT METHOD HOOKS \\
system.initialize = function () {
this.listenForEvent("minecraft:entity_death", (eventData) => this.onEntityDeath(eventData));
queryGetAllEntities = this.registerQuery();
queryGetGameStartEntity = this.registerQuery("minecraft:position");
};
system.update = function () {
let entities = this.getEntitiesFromQuery(queryGetGameStartEntity,
gameStaticVars.posEntitySpawnStartX - 2, gameStaticVars.posEntitySpawnStartY - 2, gameStaticVars.posEntitySpawnStartZ - 2,
gameStaticVars.posEntitySpawnStartX + 2, gameStaticVars.posEntitySpawnStartY + 2, gameStaticVars.posEntitySpawnStartZ + 2);
};
system.onEntityDeath = function (eventData) {
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment