simplified-mojang-api 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ import * as mc from "@minecraft/server";
7
7
  */
8
8
  export declare class AfterEventsSimplified {
9
9
  private entityDieManager;
10
+ private playerSpawnManager;
10
11
  /**
11
12
  * Eventos que se inicializan cuando la clase es llamada o inicializada.
12
13
  * @constructor
@@ -19,5 +20,12 @@ export declare class AfterEventsSimplified {
19
20
  * @public
20
21
  */
21
22
  onEntityDie(callback: (args: mc.EntityDieAfterEvent) => void): void;
23
+ /**
24
+ * Metodo auxiliar que ejecuta los eventos relacionado cuando una entidad muere de forma simplificada.
25
+ * @param {(args: mc.EntityDieAfterEvent) => void} callback Los argumentos del evento y su logica.
26
+ * @author HaJuegos - 11-03-2026
27
+ * @public
28
+ */
29
+ onPlayerSpawns(callback: (args: mc.PlayerSpawnAfterEvent) => void): void;
22
30
  }
23
31
  export declare const afterEventsSimplified: AfterEventsSimplified;
@@ -13,6 +13,7 @@ export class AfterEventsSimplified {
13
13
  */
14
14
  constructor() {
15
15
  this.entityDieManager = new BaseEventManager(mc.world.afterEvents.entityDie, "AfterEntityDie");
16
+ this.playerSpawnManager = new BaseEventManager(mc.world.afterEvents.playerSpawn, "AfterPlayerSpawn");
16
17
  }
17
18
  /**
18
19
  * Metodo auxiliar que ejecuta los eventos relacionado cuando una entidad muere de forma simplificada.
@@ -23,5 +24,14 @@ export class AfterEventsSimplified {
23
24
  onEntityDie(callback) {
24
25
  this.entityDieManager.register(callback);
25
26
  }
27
+ /**
28
+ * Metodo auxiliar que ejecuta los eventos relacionado cuando una entidad muere de forma simplificada.
29
+ * @param {(args: mc.EntityDieAfterEvent) => void} callback Los argumentos del evento y su logica.
30
+ * @author HaJuegos - 11-03-2026
31
+ * @public
32
+ */
33
+ onPlayerSpawns(callback) {
34
+ this.playerSpawnManager.register(callback);
35
+ }
26
36
  }
27
37
  export const afterEventsSimplified = new AfterEventsSimplified();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simplified-mojang-api",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "About Public repository to simplify the event logic of Mojang's Script API, for informal or professional use",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",