Skip to content

Commit

Permalink
[FIX] El fantasma no aparecia luego de morir
Browse files Browse the repository at this point in the history
  • Loading branch information
HaJuegos committed Apr 28, 2024
1 parent 930f0c5 commit 23638c7
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 26 deletions.
3 changes: 1 addition & 2 deletions comportamientos/dia0/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia1/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia10/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia11/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia12/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia2/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia3/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia4/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia5/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia6/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia7/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia8/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down
3 changes: 1 addition & 2 deletions comportamientos/dia9/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,9 @@ function swapInventory(player, coords) {
const inv = player.getComponent("minecraft:inventory").container;
const armorInv = player.getComponent("minecraft:equippable");
let dimension = player.dimension;
const radius = new mc.BlockAreaSize(5,5,5);
const armorSlots = ["Head", "Chest", "Legs", "Feet", "Offhand"];
dimension.runCommand(`summon ha:player_ghost "§e${player.name} Inventory§r" ${coords.x} ${coords.y} ${coords.z}`);
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, volume: radius })) {
for (const entity of dimension.getEntities({ type: "ha:player_ghost", location: coords, maxDistance: 1 })) {
const invGhost = entity.getComponent("minecraft:inventory").container;
for (let i = 0; i < inv.size; i++) {
let item = inv.getItem(i);
Expand Down

0 comments on commit 23638c7

Please sign in to comment.