Skip to content

Commit

Permalink
Fixed breaking changes of Script-API in version 1.19.70.02
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelDobCZ23 committed Mar 14, 2023
1 parent 39d2532 commit fc440e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { system, world, BlockLocation } from '@minecraft/server';
import { system, world } from '@minecraft/server';
import { SCHEDULED_TICKS } from './config/config';
const DIMENSION_LIST = ['minecraft:overworld','minecraft:nether','minecraft:the_end'];

system.runSchedule(() => {
system.runInterval(() => {
for (let index = 0;index < DIMENSION_LIST.length;index++) {
const dimension = world.getDimension(DIMENSION_LIST[index]);
for (const entity of dimension.getEntities()) {
try {
const blockLocation = new BlockLocation(Math.floor(entity.location.x),Math.floor(entity.location.y),Math.floor(entity.location.z));
const blockLocation = {x:Math.floor(entity.location.x),y:Math.floor(entity.location.y),z:Math.floor(entity.location.z)};
const blockStandingIn = dimension.getBlock(blockLocation);
if (blockStandingIn?.typeId === 'minecraft:campfire' || blockStandingIn?.typeId === 'minecraft:soul_campfire') {
entity.setOnFire(8);
Expand Down

0 comments on commit fc440e2

Please sign in to comment.