811 B
811 B
ezoic_fly.js — spawnSafeFallingBlock() (satır 45)
function spawnSafeFallingBlock(ctx, x, y, z, blockId, meta, vx, vy, vz) {
var w = ctx.getWorld();
var fb = null;
try {
var nbt = mappet.createCompound(
'{Block:"' + blockId + '",Data:' + meta +
',Time:1,DropItem:0b,HurtEntities:0b,NoGravity:1b}'
);
fb = w.spawnEntity("minecraft:falling_block", x, y, z, nbt);
} catch (e) { return null; }
if (!fb) return null;
try { fb.addMotion(vx, vy, vz); } catch (e) {}
(function(entity) {
ctx.scheduleScript(FB_LIFETIME, function() {
try { entity.remove(); } catch (e) {}
});
})(fb);
return fb;
}