console.clear()
ljfh = 'world.querySelectorAll('
ljfh1 = ').forEach((entity)=>{if (entity.player.name == '
ljfh2 = ') {entity.player.spawnPoint = new Box3Vector3(0, 100000000, 0);entity.player.scale = 0;entity.player.canFly = false;entity.player.canFly = false;entity.player.walkSpeed = 0;entity.player.runSpeed = 0;entity.position.set(0,10000000,0);}})'
fh = 'world.onPlayerJoin(({entity})=>{if (entity.player.name=='
fh1 = '){entity.player.spawnPoint = new Box3Vector3(0, 100000000, 0);entity.player.scale = 0;entity.player.canFly = false;entity.player.canFly = false;entity.player.walkSpeed = 0;entity.player.runSpeed = 0;entity.position.set(0,10000000,0);}})'
function glypd(number,entity)
{
if (number == 1)
{
if (TEST_PLAYER.includes(entity.player.name) || TEST_PLAYER.includes(entity.player.boxId))
{
return true
}
else return false
}
if (number == 2)
{
if (TEST_PLAYER_2.includes(entity.player.name) || TEST_PLAYER.includes(entity.player.name) || TEST_PLAYER.includes(entity.player.boxId) || TEST_PLAYER_2.includes(entity.player.boxId))
{
return true
}
else return false
}
else
{
if (TEST_PLAYER.includes(entity.player.name) || TEST_PLAYER.includes(entity.player.boxId) || TEST_PLAYER1.includes(entity.player.name) || TEST_PLAYER1.includes(entity.player.boxId) || TEST_PLAYER_2.includes(entity.player.name) || TEST_PLAYER_2.includes(entity.player.userKey))
{
return true
}
else return false
}
}
function jtcz(dm)
{
world.querySelectorAll('player').forEach((entity)=>{
try
{
eval(dm);
}
catch
{
world.say();
}
});
}
function cz(name,dm)
{
world.querySelectorAll('player').forEach((entity)=>{
if (entity.player.name == name)
{
try
{
eval(dm);
}
catch
{
world.say('你好');
}
}
});
}
function cubefill(vox, sx, sy, sz, xsize, ysize, zsize)
{
var xend = sx+xsize
var yend = sy+ysize
var zend = sz+zsize
for(var x=sx;x<xend;x++)
{
for(var y=sy;y<yend;y++)
{
for(var z=sz;z<zend;z++)
{
if ((x >= 108 && x <= 147 && z >= 4 && z <= 43)) continue;
if (voxels.getVoxel(x,y,z) != voxels.id('ice_brick','ice_wall') && (x < 123 || x > 132 || z < 123 || z > 132)) voxels.setVoxel(x,y,z,vox)
}}}
}
function sphere(vox, cx, cy, cz, radius)
{
var xend = cx+radius
var yend = cy+radius
var zend = cz+radius
for(var x=cx-radius;x<=xend;x++)
{
for(var y=cy-radius;y<=yend;y++)
{
for(var z=cz-radius;z<=zend;z++)
{
var dx = x-cx;
var dy = y-cy;
var dz = z-cz;
if (Math.round(Math.sqrt(dx*dx+dy*dy+dz*dz)) <= radius)
{
if ((x >= 108 && x <= 147 && z >= 4 && z <= 43)) continue;
if (voxels.getVoxel(x,y,z) != voxels.id('ice_brick') && (x < 123 || x > 132 || z < 123 || z > 132)) voxels.setVoxel(x,y,z,vox)
}
}}}
}
function water_sphere(vox, cx, cy, cz, radius)
{
var xend = cx+radius
var yend = cy+radius
var zend = cz+radius
for(var x=cx-radius;x<=xend;x++)
{
for(var y=cy-radius;y<=yend;y++)
{
for(var z=cz-radius;z<=zend;z++)
{
var dx = x-cx;
var dy = y-cy;
var dz = z-cz;
if (Math.round(Math.sqrt(dx*dx+dy*dy+dz*dz)) <= radius)
{
if ((x >= 108 && x <= 147 && z >= 4 && z <= 43)) continue;
if ((voxels.getVoxel(x,y,z) == voxels.id('air') || voxels.getVoxel(x,y,z) == voxels.id('water'))) voxels.setVoxel(x,y,z,vox)
}
}}}
}
function cylinder(vox, cx, cy, cz, radius, height)
{
var xend = cx+radius
var yend = cy+height
var zend = cz+radius
for(var x=cx-radius; x<=xend; x++)
{
for(var z=cz-radius; z<=zend; z++)
{
var dx = x-cx;
var dz = z-cz;
if (Math.round(Math.sqrt(dx*dx+dz*dz)) <= radius)
{
for(var y=cy; y<yend; y++)
{
if ((x >= 108 && x <= 147 && z >= 4 && z <= 43)) continue;
if (voxels.getVoxel(x,y,z) != voxels.id('ice_brick','ice_wall') && (x < 123 || x > 132 || z < 123 || z > 132)) voxels.setVoxel(x,y,z,vox)
}
}
}}
}
function pdht(x,y,z,x1,y1,z1)
{
for (var i = 1;i <= 2;i++)
{
if (x + i == x1 || x - i == x1 || y + i == y1 || y - i == y1 || z + i == z1 || z - i == z1 || (x == x1 && y == y1 && z == z1))
{
return 1;
}
}
return 0;
}
function cdfz(x,y,z,cz,entity)
{
cubefill(cz,x,y,z,35,35,35);
cubefill(0,x+1,y+1,z+1,33,33,33);
cubefill('glass',x+13,y+7,z,7,7,1);
cubefill(cz,x+13,y+10,z,7,1,1);
cubefill(cz,x+16,y+7,z,1,7,1);
cubefill('glass',x,y+7,z+13,1,7,7);
cubefill(cz,x,y+10,z+13,1,1,7);
cubefill(cz,x,y+7,z+16,1,7,1);
cubefill('glass',x+13,y+7,z+34,7,7,1);
cubefill(cz,x+13,y+10,z+34,7,1,1);
cubefill(cz,x+16,y+7,z+34,1,7,1);
cubefill('glass',x+34,y+7,z+13,1,7,7);
cubefill(cz,x+34,y+10,z+13,1,1,7);
cubefill(cz,x+34,y+7,z+16,1,7,1);
//二楼
cubefill('glass',x+13,y+22,z,7,7,1);
cubefill(cz,x+13,y+25,z,7,1,1);
cubefill(cz,x+16,y+22,z,1,7,1);
cubefill('glass',x,y+22,z+13,1,7,7);
cubefill(cz,x,y+25,z+13,1,1,7);
cubefill(cz,x,y+22,z+16,1,7,1);
cubefill('glass',x+13,y+22,z+34,7,7,1);
cubefill(cz,x+13,y+25,z+34,7,1,1);
cubefill(cz,x+16,y+22,z+34,1,7,1);
cubefill('glass',x+34,y+22,z+13,1,7,7);
cubefill(cz,x+34,y+25,z+13,1,1,7);
cubefill(cz,x+34,y+22,z+16,1,7,1);
//一楼天花板&&二楼地板
cubefill(cz,x+1,y+17,z+1,33,1,33);
cubefill('water',x+1,y+1,z+1,1,34,1);
//一楼灯
cubefill('palace_lamp',x+1,y+1,z+1,1,1,1);
cubefill('palace_lamp',x+33,y+1,z+1,1,1,1);
cubefill('palace_lamp',x+33,y+1,z+33,1,1,1);
cubefill('palace_lamp',x+1,y+1,z+33,1,1,1);
cubefill('palace_lamp',x+15,y,z+15,4,1,4);
cubefill('palace_lamp',x+7,y,z+7,4,1,4);
cubefill('palace_lamp',x+23,y,z+23,4,1,4);
cubefill('palace_lamp',x+23,y,z+7,4,1,4);
cubefill('palace_lamp',x+7,y,z+23,4,1,4);
//二楼灯
cubefill('palace_lamp',x+33,y+18,z+1,1,1,1);
cubefill('palace_lamp',x+33,y+18,z+33,1,1,1);
cubefill('palace_lamp',x+1,y+18,z+33,1,1,1);
cubefill('palace_lamp',x+15,y+17,z+15,4,1,4);
cubefill('palace_lamp',x+7,y+17,z+7,4,1,4);
cubefill('palace_lamp',x+23,y+17,z+23,4,1,4);
cubefill('palace_lamp',x+23,y+17,z+7,4,1,4);
cubefill('palace_lamp',x+7,y+17,z+23,4,1,4);
//楼顶灯
cubefill('palace_lamp',x+15,y+34,z+15,4,1,4);
cubefill('palace_lamp',x+7,y+34,z+7,4,1,4);
cubefill('palace_lamp',x+23,y+34,z+23,4,1,4);
cubefill('palace_lamp',x+23,y+34,z+7,4,1,4);
cubefill('palace_lamp',x+7,y+34,z+23,4,1,4);
//楼顶
cubefill(cz,x,y+35,z,34,2,1);
cubefill(cz,x,y+35,z+34,35,2,1);
cubefill(cz,x,y+35,z,1,2,35);
cubefill(cz,x+34,y+35,z,1,2,35);
//门
cubefill('ice',x,y+1,z+14,1,5,5);
cubefill(0,x,y+1,z+15,1,4,3);
entity.player.kg = 0;
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}
const TEST_PLAYER1 = ['MC小小建筑师','暗影无名','小乔流水(唐门13号)','友善的树毛虫cG_I','柠檬茶(仙儿家族)','阳光下的小男孩','我会一直等你','枫叶秋'];
const TEST_PLAYER_2 = ['严肃的土岩龙4Cf9','极光p1Ss~斗破天荒','干饭人是人上人','元元元','DSM海默-肖恩','努力营业的冰牙犬仆仆','冲鸭1','浏览喵家旗'];
const TEST_PLAYER = ['@拆迁老八','清帝乾隆【已黑化】','战斗的方块 ','玖月&xz','猫儿表弟小土豆.','檀玖离笙','JackyWei','神梦~初瑶','林月','李信','安念','兔子awa','谨慎的流星猫blYb','朝气的咪噜wu_E','小何[夹客家族]','黄金劳斯莱斯','秦艺泽[高级管理员]','晚柠','鷥鎩臡鏊矲樱花丶虚空','奶盖布丁','b2e6VXeiRwwt7W6','kDoyrRsYT9zVMbH','Ym0MFye6mbtANUA','活在//不是他当下ccyh','羞涩的土岩龙1jjh','黄金劳斯莱斯','林小沫','6wrVPLC5epPFH9G','','ZzQwBnq8T6XTyag'];
const TEST_PLAYER2 = ['大神Dream','任火焰蓝','勤劳的雷电猴iP7u','爱carry人的James_old_ox',"玄龙","悠闲的阿尔法gH1g","黑夜(超时空士兵)","沈子熙","拆迁队","可爱的导弹鲨yhFJ","一只小乌龟(炎神会)","AI小布","毒狼","急躁的风暴雀xUSj","无间道","guest1396","灵魂JQK","一岁呀","快手无语[火影家族]","天下第一鸣","全国第一鸣","哥犯太岁","谢君皓","guest857","无畏的阿米巴5w_","蓝昊皇","果断的树毛虫i6_k","安常[手残党","神光吒风云"];
// console_admin = ['冲锋者','黄金劳斯莱斯']//不许乱加,否则拉黑!
// Object.assign(entity, {
// particleRate: 10000,
// particleLimit: 300,
// particleSize: [2],
// particleColor: [new Box3RGBColor(1, 0, 0),
// new Box3RGBColor(1, 1, 1),
// new Box3RGBColor(10, 2, 0),
// new Box3RGBColor(10, 10, 5)],
// particleLifetime: 5,
// particleVelocitySpread: new Box3Vector3(11, 10, 11),
// });
fklbe = voxels.VoxelTypes;
world.onPlayerJoin(async({entity})=>
{
entity.player.zdfk = ''
if (!entity.player.bjb) {entity.player.bjb = 0;}
entity.player.cameraMode='follow';
entity.player.zdty = 0;
entity.player.ht = 0;
entity.player.hp = 100;
entity.player.num = 0;
entity.player.num1 = 0;
entity.player.num2 = 0;
entity.player.a = 0;
entity.player.ls = 0;
entity.player.jz = 0;
entity.player.scale = 0.8;
if (entity.player.name=="和平队长")
{
world.say("嗨喽,和平队长")
}
if (TEST_PLAYER2.includes(entity.player.name) || entity.player.boxId == "")
{
entity.player.spawnPoint = new Box3Vector3(10000, 10000, 10000);
entity.player.scale = 0;
// entity.hrut(100);
entity.player.walkSpeed = 0;
entity.player.runSpeed = 0;
entity.player.swimSpeed = 0;
entity.position.set(0,10000000,0);
}
entity.player.dialog({
type: Box3DialogType.TEXT,
content: `hello,${entity.player.name},欢迎来到建筑之地。\n电脑版按E换方块,手机版看脚底。\n如果知道方块的英文名可以用 切换+方块名称 的格式(必须是代码岛里有的方块)。\n如 切换glass 就是切换玻璃。\n如果有人毁图请在评论里反馈,谢谢配合。`,
})
entity.player.hei = [];
entity.player.fk=[['grass','dirt','water','spiderweb','stone','snow','bear_footprint','wood','acacia','green_leaf','leaf_01','leaf_02','leaf_03','leaf_04','leaf_05','leaf_06','palace_cloud','lava01','lava02','ice','polar_ice','honeycomb_01','honeycomb_02'],
['pumpkin_lantern','ledfloor01','palace_lamp','television','glass','palace_window','geometric_window_01','stone_brick_01','gold_trim_brick','star_lamp','red_gift','blue_gift','plank_02','plank_03','plank_01','plank_04','lab_material_10','brick_01','brick_02','toolbox','plank_05','plank_06','plank_07','conveyor','bounce_pad','palace_floor','treasure_chest','roof_red','roof_blue_04','roof_green','roof_yellow','palace_roof','wooden_box','bookshelf'],
['white','lemon','cadet_blue','sky_blue','olive_green'],
['pumpkin','macaroon','strawberry_juice','lime_juice','blueberry_juice','grape_juice','orange_juice','milk','soy_sauce','coffee','peach_juice','candy','biscuits'],
['carpet_01','lemon_juice']
];
entity.player.kg = 0;
entity.player.kf = 0;
entity.player.zw = 1;
entity.player.zd = 0;
entity.player.dj = 4;
entity.player.lx = 0;
entity.player.fklx = 0;
entity.player.ly = 0;
entity.player.lz = 0;
entity.player.lxcx = 0;
entity.player.canFly=true;
entity.player.enableDamage = true;
entity.player.showHealthBar = true;
world.onTick((tickEvent) => {
entity.player.num += 1;
})
})
// else if (sj >= 2 && sj < 3)
// {
// cubefill('white',entity.position.x - 3,entity.position.y - 3,entity.position.z - 3,6,6,6);
// }
// else if (sj >= 3 && sj < 4)
// {
// cubefill('stone',entity.position.x - 5,entity.position.y - 5,entity.position.z - 5,10,10,10);
// cubefill('water',entity.position.x - 2,entity.position.y - 2,entity.position.z - 2,4,4,4);
// }
// else if (sj >= 4 && sj < 5)
// {
// entity.position.set(entity.position.x,entity.position.y - 3,entity.position.z);
// cubefill('dirt',entity.position.x - 3,entity.position.y - 3,entity.position.z - 3,6,6,6);
// cubefill('blue_light',entity.position.x - 2,entity.position.y - 2,entity.position.z - 2,4,4,4);
// cubefill(0,entity.position.x - 1,entity.position.y - 1,entity.position.z - 1,2,2,2);
// world.createEntity({
// mesh:'mesh/花盆.vb',
// position:new Box3Vector3(entity.position.x,entity.position.y + 2,entity.position.z),
// meshScale:new Box3Vector3(0.1, 0.1, 0.1),
// fixed:true,
// gravity:true,
// collides:true,
// })
// }
world.onPress(async({entity, button, raycast: { voxelIndex, normal, hitEntity, direction, attacker,} }) =>{//监听按下去
if (TEST_PLAYER2.includes(entity.player.name)){return;}
var v1 = voxelIndex.add(normal);
if (v1.x >= 108 && v1.x <= 147 && v1.z >= 4 && v1.z <= 43 && !glypd(3,entity))
{
entity.player.directMessage('需要先向3级管理员或作者申请才能在这里建造');
return;
}
if (button == Box3ButtonType.ACTION0 || button == Box3ButtonType.ACTION1)
{
if (entity.player.num < entity.player.num1 + 3 && !pdht(v1.x,v1.y,v1.z,entity.player.lx,entity.player.ly,entity.player.lz) && entity.player.lxcx == 0)
{
entity.player.lxcx = 1;
}
// else if (entity.player.num < entity.player.num1 + 3 && !pdht(v1.x,v1.y,v1.z,entity.player.lx,entity.player.ly,entity.player.lz) && entity.player.lxcx == 1)
// {
// try
// {
// entityn = entity.player.name;
// world.onPlayerJoin(({entity})=>{
// if (entity.player.name == entityn)
// {
// entity.player.spawnPoint = new Box3Vector3(0, 10000000, 0);entity.player.scale = 0;entity.player.canFly = false;entity.player.canFly = false;entity.player.walkSpeed = 0;entity.player.runSpeed = 0;entity.position.set(0,10000000,0);
// }
// });
// entity.player.scale = 0;
// entity.player.hp = 0;
// entity.player.walkSpeed = 0;
// entity.player.runSpeed = 0;
// entity.player.swimSpeed = 0;
// entity.position.set(0,1000000,0);
// }
// catch (error)
// {
// entity.player.directMessage('Error:' + error);
// };
// entity.player.directMessage('你的行为疑似毁图,禁止游玩');
// }
else
{
entity.player.lxcx = 0;
}
entity.player.lx = v1.x;
entity.player.ly = v1.y;
entity.player.lz = v1.z;
entity.player.num1 = entity.player.num;
}
if (button == Box3ButtonType.ACTION0)
{
var v = voxelIndex.add(normal);
var x1 = voxelIndex.x
var y1 = voxelIndex.y
var z1 = voxelIndex.z
if (voxels.getVoxel(x1, y1, z1) == 145) {entity.player.directMessage('不可以破坏这个台子')}
else if (hitEntity && !hitEntity.isPlayer && hitEntity.hasTag('和平') == false && hitEntity.hasTag('告示') == false && hitEntity.hasTag('列表') == false)
{
entity.player.num1 = 0;
Object.assign(hitEntity, {
particleRate: 100,
particleLimit: 30,
particleSize: [2],
particleColor: [new Box3RGBColor(0, 100, 1)],
particleLifetime: 10,
particleVelocitySpread: new Box3Vector3(3, 1, 3),
particleAcceleration: new Box3Vector3(0, -20, 0)
});
hitEntity.meshInvisible = true;
for (i = 0;i <= 1;i++)
{
setTimeout(() => {
if (entity.player.num1 == 1)
{
Object.assign(hitEntity, {particleRate: 0});
if (hitEntity.hasTag('随机'))
{
const sj = Math.random() * 16;
if (sj >= 0 && sj < 1)
{
entity.player.scale = 0.5;
}
else if (sj >= 1 && sj < 2)
{
entity.position.set(128,1000,128);
}
else if (sj >= 5 && sj < 6)
{
entity.meshEmissive = 1000;
setTimeout(() => {
entity.player.num1 = 0;
Object.assign(entity, {
particleRate: 10000,
particleLimit: 300,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(1, 1, 1),
new Box3RGBColor(10, 2, 0),
new Box3RGBColor(10, 10, 5)],
particleLifetime: 5,
particleVelocitySpread: new Box3Vector3(11, 10, 11),
});
entity.meshInvisible = true;
for (i = 0;i <= 1;i++)
{
setTimeout(() => {
if (entity.player.num1 == 1)
{
Object.assign(entity, {particleRate: 0});
entity.destroy();
}
entity.player.num1 = 1;
}, 150);
}
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}, 0);
entity.velocity.y += 1;
}
else if (sj >= 6 && sj < 7)
{
world.createEntity({
mesh:'mesh/幸运方块.vb',
position:new Box3Vector3(entity.position.x,entity.position.y + 2,entity.position.z),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
});
world.createEntity({
mesh:'mesh/幸运方块.vb',
position:new Box3Vector3(entity.position.x,entity.position.y - 1,entity.position.z),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
});
world.createEntity({
mesh:'mesh/幸运方块.vb',
position:new Box3Vector3(entity.position.x + 1,entity.position.y,entity.position.z),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
});
world.createEntity({
mesh:'mesh/幸运方块.vb',
position:new Box3Vector3(entity.position.x - 1,entity.position.y,entity.position.z),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
});
world.createEntity({
mesh:'mesh/幸运方块.vb',
position:new Box3Vector3(entity.position.x,entity.position.y,entity.position.z + 1),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
});
world.createEntity({
mesh:'mesh/幸运方块.vb',
position:new Box3Vector3(entity.position.x,entity.position.y,entity.position.z - 1),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
});
}
else if (sj >= 7 && sj < 8)
{
Object.assign(entity, {
particleRate: 100,
particleLimit: 30,
particleSize: [2,3,4,5],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(1, 1, 1),
new Box3RGBColor(10, 2, 0),
new Box3RGBColor(10, 10, 5)],
particleLifetime: 2,
particleVelocitySpread: new Box3Vector3(1, 1, 1),
});
}
else if (sj >= 8 && sj < 9)
{
entity.player.color = new Box3RGBColor(255, 0, 0)
}
else if (sj >= 9 && sj < 10)
{
entity.player.color = new Box3RGBColor(0, 255, 0)
}
else if (sj >= 10 && sj < 11)
{
entity.player.color = new Box3RGBColor(0, 0, 255)
}
else if (sj >= 11 && sj < 12)
{
entity.player.color = new Box3RGBColor(0, 255, 255)
}
else if (sj >= 12 && sj < 13)
{
entity.player.color = new Box3RGBColor(255, 255, 255)
}
else if (sj >= 13 && sj < 14)
{
entity.player.color = new Box3RGBColor(255, 255, 0)
}
else if (sj >= 14 && sj < 15)
{
entity.player.color = new Box3RGBColor(255, 0, 255)
}
else
{
entity.player.scale = 5;
}
}
hitEntity.destroy();
}
entity.player.num1 = 1;
}, 150);
}
world.sound('audio/break_block.mp3');
}
else if (entity.player.ls == 1)
{
entity.player.qx = voxelIndex.x;
entity.player.qy = voxelIndex.y;
entity.player.qz = voxelIndex.z;
entity.player.x = voxelIndex.x;
entity.player.y = voxelIndex.y;
entity.player.z = voxelIndex.z;
entity.player.q = voxels.getVoxel(entity.player.qx,entity.player.qy,entity.player.qz);
entity.player.num = 1;
voxels.setVoxel(voxelIndex.x,voxelIndex.y,voxelIndex.z,0);
entity.player.t = 0;
entity.player.h = 0;
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dy = [0,0,1,-1,0,0];
entity.player.dz = [1,-1,0,0,0,0];
entity.player.c = [entity.player.x,0,0,0,0,0,0,0,0,0];
entity.player.c1 = [entity.player.y,0,0,0,0,0,0,0,0,0];
entity.player.c2 = [entity.player.z,0,0,0,0,0,0,0,0,0];
while (entity.player.num < 20 && entity.player.h < 100)
{
for (var i = 0;i < 6;i++)
{
entity.player.x = entity.player.c[entity.player.h];
entity.player.y = entity.player.c1[entity.player.h];
entity.player.z = entity.player.c2[entity.player.h];
entity.player.x += entity.player.dx[i];
entity.player.y += entity.player.dy[i];
entity.player.z += entity.player.dz[i];
if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z) == entity.player.q)
{
voxels.setVoxel(entity.player.x,entity.player.y,entity.player.z,0);
entity.player.t++;
entity.player.c[entity.player.t] = entity.player.x;
entity.player.c1[entity.player.t] = entity.player.y;
entity.player.c2[entity.player.t] = entity.player.z;
entity.player.num++;
}
if (entity.player.num == 20)
{
break;
}
}
entity.player.h++;
}
}
else {voxels.setVoxel(voxelIndex.x,voxelIndex.y,voxelIndex.z,0);}
}
if (button == Box3ButtonType.ACTION1)
{ //如果是action1,对应电脑端右
var v = voxelIndex.add(normal);
if (v.x < 123 || v.x > 132 || v.z < 123 || v.z > 132)
{
if (entity.player.jz == 1)
{
entity.player.qx = v.x;
entity.player.qy = v.y;
entity.player.qz = v.z;
entity.player.x = v.x;
entity.player.y = v.y;
entity.player.z = v.z;
entity.player.q = voxels.getVoxel(entity.player.qx,entity.player.qy,entity.player.qz);
entity.player.num = 1;
entity.player.t = 0;
entity.player.h = 0;
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dy = [0,0,1,-1,0,0];
entity.player.dz = [1,-1,0,0,0,0];
entity.player.c = [entity.player.x,0,0,0,0,0,0,0,0,0];
entity.player.c1 = [entity.player.y,0,0,0,0,0,0,0,0,0];
entity.player.c2 = [entity.player.z,0,0,0,0,0,0,0,0,0];
while (entity.player.num < 50 && entity.player.h < 200)
{
for (var i = 0;i < 6;i++)
{
entity.player.x = entity.player.c[entity.player.h];
entity.player.y = entity.player.c1[entity.player.h];
entity.player.z = entity.player.c2[entity.player.h];
entity.player.x += entity.player.dx[i];
entity.player.y += entity.player.dy[i];
entity.player.z += entity.player.dz[i];
if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z) == 0 && (entity.player.x < 123 || entity.player.x > 132 || entity.player.z < 123 || entity.player.z > 132))
{
voxels.setVoxel(entity.player.x,entity.player.y,entity.player.z,entity.player.fk[entity.player.fklx][entity.player.kf]);
entity.player.t++;
entity.player.c[entity.player.t] = entity.player.x;
entity.player.c1[entity.player.t] = entity.player.y;
entity.player.c2[entity.player.t] = entity.player.z;
entity.player.num++;
}
if (entity.player.num == 50)
{
break;
}
}
entity.player.h++;
}
}
else if (entity.player.jz == 2)
{
entity.player.qx = v.x;
entity.player.qy = v.y;
entity.player.qz = v.z;
entity.player.x = v.x;
entity.player.y = v.y;
entity.player.z = v.z;
entity.player.q = voxels.getVoxel(entity.player.qx,entity.player.qy,entity.player.qz);
entity.player.num = 1;
entity.player.t = 0;
entity.player.h = 0;
entity.player.c = [entity.player.x,0,0,0,0,0,0,0,0,0];
entity.player.c1 = [entity.player.y,0,0,0,0,0,0,0,0,0];
entity.player.c2 = [entity.player.z,0,0,0,0,0,0,0,0,0];
if ((voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) == 0 && voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) == 0) && (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z + 1) == 0 && voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z - 1) == 0))
{
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dz = [1,-1,0,0,0,0];
entity.player.dy = [0,0,0,0,0,0];
}
else if (voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) != 0 || voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) != 0)
{
entity.player.dx = [0,0,0,0,1,-1];
if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z + 1) != 0 || voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z - 1) != 0)
{
entity.player.dz = [1,-1,0,0,0,0];
entity.player.dy = [0,0,0,0,0,0];
}
else
{
entity.player.dy = [0,0,1,-1,0,0];
entity.player.dz = [0,0,0,0,0,0];
}
}
else if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z + 1) != 0 || voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z - 1) != 0)
{
entity.player.dz = [1,-1,0,0,0,0];
if (voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) != 0 || voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) != 0)
{
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dy = [0,0,0,0,0,0];
}
else
{
entity.player.dy = [0,0,1,-1,0,0];
entity.player.dx = [0,0,0,0,0,0];
}
}
else
{
entity.player.dy = [0,0,1,-1,0,0];
if (voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) != 0 || voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) != 0)
{
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dz = [0,0,0,0,0,0];
}
else
{
entity.player.dz = [1,-1,0,0,0,0];
entity.player.dx = [0,0,0,0,0,0];
}
}
while (entity.player.num < 50 && entity.player.h < 200)
{
for (var i = 0;i < 6;i++)
{
entity.player.x = entity.player.c[entity.player.h];
entity.player.y = entity.player.c1[entity.player.h];
entity.player.z = entity.player.c2[entity.player.h];
entity.player.x += entity.player.dx[i];
entity.player.y += entity.player.dy[i];
entity.player.z += entity.player.dz[i];
if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z) == 0 && (entity.player.x < 123 || entity.player.x > 132 || entity.player.z < 123 || entity.player.z > 132))
{
voxels.setVoxel(entity.player.x,entity.player.y,entity.player.z,entity.player.fk[entity.player.fklx][entity.player.kf]);
entity.player.t++;
entity.player.c[entity.player.t] = entity.player.x;
entity.player.c1[entity.player.t] = entity.player.y;
entity.player.c2[entity.player.t] = entity.player.z;
entity.player.num++;
}
if (entity.player.num == 50)
{
break;
}
}
entity.player.h++;
}
}
else if (entity.player.jz == 3)
{
entity.player.qx = voxelIndex.x;
entity.player.qy = voxelIndex.y;
entity.player.qz = voxelIndex.z;
entity.player.x = voxelIndex.x;
entity.player.y = voxelIndex.y;
entity.player.z = voxelIndex.z;
entity.player.q = voxels.getVoxel(entity.player.qx,entity.player.qy,entity.player.qz);
entity.player.num = 1;
entity.player.t = 0;
entity.player.h = 0;
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dy = [0,0,1,-1,0,0];
entity.player.dz = [1,-1,0,0,0,0];
entity.player.c = [entity.player.x,0,0,0,0,0,0,0,0,0];
entity.player.c1 = [entity.player.y,0,0,0,0,0,0,0,0,0];
entity.player.c2 = [entity.player.z,0,0,0,0,0,0,0,0,0];
while (entity.player.num < 30 && entity.player.h < 200)
{
for (var i = 0;i < 6;i++)
{
entity.player.x = entity.player.c[entity.player.h];
entity.player.y = entity.player.c1[entity.player.h];
entity.player.z = entity.player.c2[entity.player.h];
entity.player.x += entity.player.dx[i];
entity.player.y += entity.player.dy[i];
entity.player.z += entity.player.dz[i];
if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z) == entity.player.q && entity.player.q != voxels.id('ice_brick'))
{
voxels.setVoxel(entity.player.x,entity.player.y,entity.player.z,entity.player.fk[entity.player.fklx][entity.player.kf]);
entity.player.t++;
entity.player.c[entity.player.t] = entity.player.x;
entity.player.c1[entity.player.t] = entity.player.y;
entity.player.c2[entity.player.t] = entity.player.z;
entity.player.num++;
}
if (entity.player.num == 30)
{
break;
}
}
entity.player.h++;
}
}
else if (entity.player.jz == 4)
{
entity.player.qx = voxelIndex.x;
entity.player.qy = voxelIndex.y;
entity.player.qz = voxelIndex.z;
entity.player.x = voxelIndex.x;
entity.player.y = voxelIndex.y;
entity.player.z = voxelIndex.z;
entity.player.q = voxels.getVoxel(entity.player.qx,entity.player.qy,entity.player.qz);
entity.player.num = 1;
entity.player.t = 0;
entity.player.h = 0;
entity.player.c = [entity.player.x,0,0,0,0,0,0,0,0,0];
entity.player.c1 = [entity.player.y,0,0,0,0,0,0,0,0,0];
entity.player.c2 = [entity.player.z,0,0,0,0,0,0,0,0,0];
if ((voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) == 0 && voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) == 0) && (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z + 1) == 0 && voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z - 1) == 0))
{
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dz = [1,-1,0,0,0,0];
entity.player.dy = [0,0,0,0,0,0];
}
else if (voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) != 0 || voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) != 0)
{
entity.player.dx = [0,0,0,0,1,-1];
if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z + 1) != 0 || voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z - 1) != 0)
{
entity.player.dz = [1,-1,0,0,0,0];
entity.player.dy = [0,0,0,0,0,0];
}
else
{
entity.player.dy = [0,0,1,-1,0,0];
entity.player.dz = [0,0,0,0,0,0];
}
}
else if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z + 1) != 0 || voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z - 1) != 0)
{
entity.player.dz = [1,-1,0,0,0,0];
if (voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) != 0 || voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) != 0)
{
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dy = [0,0,0,0,0,0];
}
else
{
entity.player.dy = [0,0,1,-1,0,0];
entity.player.dx = [0,0,0,0,0,0];
}
}
else
{
entity.player.dy = [0,0,1,-1,0,0];
if (voxels.getVoxel(entity.player.x + 1,entity.player.y,entity.player.z) != 0 || voxels.getVoxel(entity.player.x - 1,entity.player.y,entity.player.z) != 0)
{
entity.player.dx = [0,0,0,0,1,-1];
entity.player.dz = [0,0,0,0,0,0];
}
else
{
entity.player.dz = [1,-1,0,0,0,0];
entity.player.dx = [0,0,0,0,0,0];
}
}
while (entity.player.num < 50 && entity.player.h < 200)
{
for (var i = 0;i < 6;i++)
{
entity.player.x = entity.player.c[entity.player.h];
entity.player.y = entity.player.c1[entity.player.h];
entity.player.z = entity.player.c2[entity.player.h];
entity.player.x += entity.player.dx[i];
entity.player.y += entity.player.dy[i];
entity.player.z += entity.player.dz[i];
if (voxels.getVoxel(entity.player.x,entity.player.y,entity.player.z) == entity.player.q && entity.player.q != voxels.id('ice_brick'))
{
voxels.setVoxel(entity.player.x,entity.player.y,entity.player.z,entity.player.fk[entity.player.fklx][entity.player.kf]);
entity.player.t++;
entity.player.c[entity.player.t] = entity.player.x;
entity.player.c1[entity.player.t] = entity.player.y;
entity.player.c2[entity.player.t] = entity.player.z;
entity.player.num++;
}
if (entity.player.num == 50)
{
break;
}
}
entity.player.h++;
}
}
else if (hitEntity && !hitEntity.isPlayer && hitEntity.hasTag('和平') == false && hitEntity.hasTag('告示') == false && hitEntity.hasTag('告示1') == false && hitEntity.hasTag('列表') == false)
{
if (!hitEntity.hasTag('其他') && !hitEntity.hasTag('炸弹') && !hitEntity.hasTag('岩浆'))
{
hitEntity.collides = !hitEntity.collides;
if (hitEntity.hasTag('开'))
{
hitEntity.meshEmissive = 0;
hitEntity.removeTag('开');
}
else
{
hitEntity.meshEmissive = 100;
hitEntity.addTag('开');
}
}
else if (hitEntity.hasTag('炸弹'))
{
setTimeout(() => {
hitEntity.meshEmissive = 0;
}, 4000);
hitEntity.meshEmissive = 1000;
setTimeout(() => {
entity.player.num1 = 0;
Object.assign(hitEntity, {
particleRate: 10000,
particleLimit: 300,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(1, 1, 1),
new Box3RGBColor(10, 2, 0),
new Box3RGBColor(10, 10, 5)],
particleLifetime: 3,
particleVelocitySpread: new Box3Vector3(11, 10, 11),
});
hitEntity.meshInvisible = true;
for (i = 0;i <= 1;i++)
{
setTimeout(() => {
if (entity.player.num1 == 1)
{
Object.assign(hitEntity, {particleRate: 0});
hitEntity.destroy();
}
entity.player.num1 = 1;
}, 150);
}
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}, 2000);
}
}
else if (entity.player.zw == 0 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/oak_door.vb',
position:new Box3Vector3(v.x,v.y + 1,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:false,
collides:true,
meshInvisible:false
})
}
else if (entity.player.zw == 1 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/oak_door.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 1,v.z),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshOrientation:new Box3Quaternion(0, 1, 0, 1)
})
}
else if (entity.player.zw == 2 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/oak_door.vb',
position:new Box3Vector3(v.x + 1,v.y + 1,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshOrientation:new Box3Quaternion(0, 0, 0, 1)
})
}
else if (entity.player.zw == 3 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/oak_door.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 1,v.z + 1),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshOrientation:new Box3Quaternion(0, 1, 0, 1)
})
}
else if (entity.player.zw == 4 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/木制天窗.vb',
position:new Box3Vector3(v.x + 0.5,v.y,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
})
}
else if (entity.player.zw == 5 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/木制天窗.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 1,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
})
}
else if (entity.player.zw == 6 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/花盆.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.75,v.z + 0.5),
meshScale:new Box3Vector3(0.1, 0.1, 0.1),
fixed:true,
gravity:true,
collides:true,
})
}
else if (entity.player.zw == 7 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/方格楼梯.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
tags:'其他'
})
}
else if (entity.player.zw == 8 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/方格楼梯.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshOrientation:new Box3Quaternion(0, 1, 0, 1),
tags:'其他'
})
}
else if (entity.player.zw == 9 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/方格楼梯.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshOrientation:new Box3Quaternion(0, 1, 0, 0),
tags:'其他'
})
}
else if (entity.player.zw == 10 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/方格楼梯.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshOrientation:new Box3Quaternion(1, 1, 1, 1),
tags:'其他'
})
}
else if (entity.player.zw == 11 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/方格台阶.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.25,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
tags:'其他'
})
}
else if (entity.player.dj == 0 && entity.player.kg == 0)
{
entity.position.set(v.x,v.y + 1,v.z);
}
else if (entity.player.dj == 1 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/火把.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.25,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:false,
tags:'其他'
})
}
else if (entity.player.dj == 2 && entity.player.kg == 0)
{
world.createEntity({
mesh:'mesh/TNT.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'炸弹'
})
}
else if (entity.player.dj == 3 && entity.player.kg == 0)
{
var fx = voxels.getVoxelRotation(voxelIndex.x,voxelIndex.y,voxelIndex.z)
var cz = voxels.getVoxel(voxelIndex.x,voxelIndex.y,voxelIndex.z)
voxels.setVoxel(voxelIndex.x,voxelIndex.y,voxelIndex.z,cz,fx + 1);
}
else if (entity.player.dj == 4 && entity.player.kg == 0)
{
entity.player.directMessage('已禁用')
//water_sphere('water',voxelIndex.x,voxelIndex.y,voxelIndex.z,1);
}
else if (entity.player.dj == 5 && entity.player.kg == 0)
{
water_sphere(0,voxelIndex.x,voxelIndex.y,voxelIndex.z,1);
}
else if (entity.player.dj == 6 && entity.player.kg == 0)
{
const e = world.createEntity({
mesh:'mesh/我的世界烟花.vb',
position:new Box3Vector3(v.x + 0.5,v.y - 5,v.z + 0.5),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:false,
meshInvisible:false,
tags:'炸弹'
})
e.velocity.y += 2;
Object.assign(e, {
particleRate: 1000,
particleLimit: 1000,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(0, 0, 0),],
particleLifetime: 0.5,
particleVelocitySpread: new Box3Vector3(1, 1, 1),
});
setTimeout(() => {
e.meshEmissive = 0;
}, 3000);
setTimeout(() => {
Object.assign(e, {
particleRate: 10000,
particleLimit: 300,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(1, 1, 1),
new Box3RGBColor(10, 2, 0),
new Box3RGBColor(10, 10, 5)],
particleLifetime: 3,
particleVelocitySpread: new Box3Vector3(11, 10, 11),
});
e.meshInvisible = true;
for (i = 0;i <= 1;i++)
{
setTimeout(() => {
if (entity.player.num1 == 1)
{
Object.assign(e, {particleRate: 0});
e.destroy();
}
entity.player.num1 = 1;
}, 150);
}
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}, 2000);
}
else if (entity.player.dj == 7 && entity.player.kg == 0)
{
const e = world.createEntity({
mesh:'mesh/我的世界烟花.vb',
position:new Box3Vector3(entity.position.x,entity.position.y - 10,entity.position.z),
meshScale:new Box3Vector3(0.065, 0.065, 0.065),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'炸弹'
})
e.velocity.y += 3;
Object.assign(e, {
particleRate: 1000,
particleLimit: 1000,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(0, 0, 0),],
particleLifetime: 0.5,
particleVelocitySpread: new Box3Vector3(1, 1, 1),
});
setTimeout(() => {
e.meshEmissive = 0;
}, 8000);
setTimeout(() => {
Object.assign(e, {
particleRate: 10000,
particleLimit: 300,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(1, 1, 1),
new Box3RGBColor(10, 2, 0),
new Box3RGBColor(10, 10, 5)],
particleLifetime: 3,
particleVelocitySpread: new Box3Vector3(11, 10, 11),
});
e.meshInvisible = true;
for (i = 0;i <= 1;i++)
{
setTimeout(() => {
if (entity.player.num1 == 1)
{
Object.assign(e, {particleRate: 0});
e.destroy();
}
entity.player.num1 = 1;
}, 150);
}
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}, 3000);
}
else if (entity.player.dj == 8 && entity.player.kg == 0)
{
const e = world.createEntity({
mesh:'mesh/幸运方块.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
})
e.velocity.y += 2;
Object.assign(e, {
particleRate: 1000,
particleLimit: 1000,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(0, 0, 0),],
particleLifetime: 0.5,
particleVelocitySpread: new Box3Vector3(1, 1, 1),
});
}
else if (entity.player.dj == 9 && entity.player.kg == 0)
{
const zbx = [0,1,2,1,2,3,3,4,4,3];
const zbz = [0,1,2,-1,-2,-2,2,-1,1,0];
const e = world.createEntity({
mesh:'mesh/我的世界烟花.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'随机'
});
e.velocity.y += 2;
Object.assign(e, {
particleRate: 1000,
particleLimit: 1000,
particleSize: [2],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(0, 0, 0),],
particleLifetime: 0.5,
particleVelocitySpread: new Box3Vector3(1, 1, 1),
});
setTimeout(() => {
e.meshEmissive = 0;
}, 3000);
setTimeout(() => {
Object.assign(e, {
particleRate: 10000,
particleLimit: 1000,
particleSize: [3],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(1, 1, 1),
new Box3RGBColor(10, 2, 0),
new Box3RGBColor(10, 10, 5)],
particleLifetime: 5,
particleVelocitySpread: new Box3Vector3(2, 2, 2),
});
e.meshInvisible = true;
ex = e.position.x;
ez = e.position.z;
ey = e.position.y;
e.velocity.y = 0;
for (i = 0;i < 10;i++)
{
const e = world.createEntity({
mesh:'mesh/我的世界烟花.vb',
position:new Box3Vector3(ex + zbx[i] * 2, ey, ez + zbz[i] * 2),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
tags:'克隆体'
});
Object.assign(e, {
particleRate: 1000,
particleLimit: 1000,
particleSize: [3],
particleColor: [new Box3RGBColor(1, 0, 0),
new Box3RGBColor(0, 0, 0),],
particleLifetime: 3,
particleVelocitySpread: new Box3Vector3(2, 2, 2),
});
}
for (i = 0;i <= 1;i++)
{
setTimeout(() => {
if (entity.player.num1 == 1)
{
Object.assign(e, {particleRate: 0});
e.destroy();
world.querySelectorAll('*').forEach((e)=>{if (e.hasTag('克隆体'))e.destroy();});
}
entity.player.num1 = 1;
}, 150);
};
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
});
}, 2000);
}
else if (entity.player.dj == 10 && entity.player.kg == 0)
{
const e = world.createEntity({
mesh:'mesh/岩浆.vb',
position:new Box3Vector3(v.x + 0.5,v.y + 0.5,v.z + 0.5),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:false,
gravity:false,
collides:false,
meshInvisible:false,
tags:'岩浆'
})
}
else if (entity.player.dj == 11 && entity.player.kg == 0)
{
var mx = voxelIndex.x;
var my = voxelIndex.y;
var mz = voxelIndex.z;
if (voxels.getVoxel(mx,my,mz) == voxels.id('lava01') && voxels.getVoxel(mx,my + 3,mz) == voxels.id('lava02') && voxels.getVoxel(mx,my + 1,mz) == voxels.id('strawberry_juice') && voxels.getVoxel(mx,my + 2,mz) == voxels.id('strawberry_juice'))
{
voxels.setVoxel(mx,my,mz,0);
voxels.setVoxel(mx,my + 1,mz,0);
voxels.setVoxel(mx,my + 2,mz,0);
voxels.setVoxel(mx,my + 3,mz,0);
world.createEntity({
mesh:'mesh/传送门.vb',
position:new Box3Vector3(v.x - 0.5,v.y + 0.05,v.z + 0.5),
meshScale:new Box3Vector3(0.058, 0.058, 0.058),
fixed:true,
gravity:true,
collides:true,
meshInvisible:false,
meshColor: new Box3RGBAColor(1, 0, 0, 1),
meshEmissive: 1,
meshMetalness: 1,
meshShininess: 1,
tags:'传送门'
})
}
}
else if (hitEntity && !hitEntity.isPlayer && hitEntity.hasTag('告示'))
{
entity.player.dialog({
type: Box3DialogType.TEXT,
content: `指令列表(在聊天框发送相应指令即可)\n第一人称 作用:切换第一人称视角\n第三人称 作用:切换第三人称视角\n 看不见路的人称 作用:试试就知道了\n开启快速填色 作用:替换一部分相同材质的方块\n开启平面快速填色 作用:替换平面上一部分相同材质的方块\n关闭快速填色 作用:关闭快速填色模式/平面快速填色模式\n方块列表/全部方块/block 作用:显示所有方块名称(英文),可用切换方块名称的格式切换,如切换glass\n加速 作用:加快人物移动和飞行速度\n发申请管理员申请当管理员`,
})
}
else if (hitEntity && !hitEntity.isPlayer && hitEntity.hasTag('告示1'))
{
entity.player.dialog({
type: Box3DialogType.TEXT,
content: `建房区(想要在上面建造需要申请哦~)`,
})
}
else if (hitEntity && !hitEntity.isPlayer && hitEntity.hasTag('列表'))
{
entity.player.dialog({
type: Box3DialogType.TEXT,
content: `如果想看格式好一点的就在聊天区发送 方块列表\n方块列表(在聊天框发送 切换方块名称 的格式即可切换,如:切换glass)\n` + fklbe,
})
}
else if (entity.player.kg == 1 && glypd(3,entity))
{
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x,v.y,v.z,7,7,7);
cubefill(0,v.x+1,v.y+1,v.z+1,5,5,5);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x-1,v.y+7,v.z-1,9,1,9);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x,v.y+8,v.z,7,1,7);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+1,v.y+9,v.z+1,5,1,5);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+2,v.y+10,v.z+2,3,1,3);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+3,v.y+11,v.z+3,1,1,1);
voxels.setVoxel(v.x+1,v.y+5,v.z+1,"palace_lamp")
voxels.setVoxel(v.x+5,v.y+5,v.z+5,"palace_lamp")
voxels.setVoxel(v.x+1,v.y+5,v.z+5,"palace_lamp")
voxels.setVoxel(v.x+5,v.y+5,v.z+1,"palace_lamp")
entity.player.kg = 0;
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}
else if (entity.player.kg == 2 && glypd(3,entity))
{
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x,v.y,v.z,17,17,17);
cubefill(0,v.x+1,v.y+1,v.z+1,15,15,15);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x-1,v.y+17,v.z-1,19,1,19);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x,v.y+18,v.z,17,1,17);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+1,v.y+19,v.z+1,15,1,15);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+2,v.y+20,v.z+2,13,1,13);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+3,v.y+21,v.z+3,11,1,11);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+4,v.y+22,v.z+4,9,1,9);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+5,v.y+23,v.z+5,7,1,7);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+6,v.y+24,v.z+6,5,1,5);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+7,v.y+25,v.z+7,3,1,3);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x+8,v.y+26,v.z+8,1,1,1);
voxels.setVoxel(v.x+1,v.y+15,v.z+1,"palace_lamp")
voxels.setVoxel(v.x+15,v.y+15,v.z+15,"palace_lamp")
voxels.setVoxel(v.x+1,v.y+15,v.z+15,"palace_lamp")
voxels.setVoxel(v.x+15,v.y+15,v.z+1,"palace_lamp")
voxels.setVoxel(v.x+1,v.y+1,v.z+1,"palace_lamp")
voxels.setVoxel(v.x+15,v.y+1,v.z+15,"palace_lamp")
voxels.setVoxel(v.x+1,v.y+1,v.z+15,"palace_lamp")
voxels.setVoxel(v.x+15,v.y+1,v.z+1,"palace_lamp")
voxels.setVoxel(v.x+8,v.y+1,v.z+1,"palace_lamp")
voxels.setVoxel(v.x+1,v.y+1,v.z+8,"palace_lamp")
voxels.setVoxel(v.x+15,v.y+1,v.z+8,"palace_lamp")
voxels.setVoxel(v.x+8,v.y+1,v.z+15,"palace_lamp")
voxels.setVoxel(v.x+8,v.y+15,v.z+1,"palace_lamp")
voxels.setVoxel(v.x+1,v.y+15,v.z+8,"palace_lamp")
voxels.setVoxel(v.x+15,v.y+15,v.z+8,"palace_lamp")
voxels.setVoxel(v.x+8,v.y+15,v.z+15,"palace_lamp")
voxels.setVoxel(v.x+8,v.y+8,v.z+16,"star_lamp")
voxels.setVoxel(v.x+7,v.y+8,v.z+16,"glass")
voxels.setVoxel(v.x+9,v.y+8,v.z+16,"glass")
voxels.setVoxel(v.x+8,v.y+7,v.z+16,"glass")
voxels.setVoxel(v.x+8,v.y+9,v.z+16,"glass")
voxels.setVoxel(v.x+9,v.y+9,v.z+16,"glass")
voxels.setVoxel(v.x+7,v.y+7,v.z+16,"glass")
voxels.setVoxel(v.x+9,v.y+7,v.z+16,"glass")
voxels.setVoxel(v.x+7,v.y+9,v.z+16,"glass")
voxels.setVoxel(v.x+16,v.y+8,v.z+8,"glass")
voxels.setVoxel(v.x+8,v.y+8,v.z,"glass")
voxels.setVoxel(v.x,v.y+8,v.z+8,"glass")
voxels.setVoxel(v.x+8,v.y,v.z+17,entity.player.fk[entity.player.fklx][entity.player.kf])
voxels.setVoxel(v.x+8,v.y+2,v.z+16,0)
voxels.setVoxel(v.x+8,v.y+3,v.z+16,0)
voxels.setVoxel(v.x+8,v.y+4,v.z+16,0)
entity.player.kg = 0;
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}
else if (entity.player.kg == 3 && glypd(3,entity))
{
cdfz(v.x,v.y,v.z,entity.player.fk[entity.player.fklx][entity.player.kf],entity);
}else if (entity.player.kg == 4 && glypd(3,entity))
{
cylinder(entity.player.fk[entity.player.fklx][entity.player.kf], v.x, v.y - 6, v.z, 8, 7);
cylinder('water', v.x, v.y - 5, v.z, 7, 6);
entity.player.kg = 0;
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}else if (entity.player.kg == 5 && glypd(3,entity))
{
cylinder(entity.player.fk[entity.player.fklx][entity.player.kf], v.x, v.y - 6, v.z, 6, 5);
cylinder('water', v.x, v.y - 5, v.z, 5, 4);
entity.player.kg = 0;
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}else if (entity.player.kg == 6 && glypd(3,entity))
{
cylinder(entity.player.fk[entity.player.fklx][entity.player.kf], v.x, v.y - 6, v.z, 8, 7);
cylinder('water', v.x, v.y - 5, v.z, 7, 6);
cylinder('blueberry_juice', v.x, v.y + 8, v.z, 1, 1);
cylinder('blueberry_juice', v.x, v.y + 6, v.z, 2, 2);
cylinder('blueberry_juice', v.x, v.y + 4, v.z, 3, 2);
cylinder('blueberry_juice', v.x, v.y + 3, v.z, 4, 1);
cylinder('blueberry_juice', v.x, v.y + 1, v.z, 5, 2);
cylinder(0, v.x, v.y + 6, v.z, 1, 2);
cylinder(0, v.x, v.y + 4, v.z, 2, 2);
cylinder(0, v.x, v.y + 3, v.z, 3, 1);
cylinder(0, v.x, v.y + 1, v.z, 4, 2);
cubefill(entity.player.fk[entity.player.fklx][entity.player.kf],v.x,v.y - 6,v.z,1,14,1);
entity.player.kg = 0;
world.sound({
sample: 'audio/gunshot.mp3',
position: new Box3Vector3(64, 10, 64),
radius: 10000
})
}
else
{
if (entity.player.kf == -2) voxels.setVoxel(v.x, v.y, v.z, entity.player.zdfk);
else voxels.setVoxel(v.x, v.y, v.z, entity.player.fk[entity.player.fklx][entity.player.kf]);
}
}
else
{
entity.player.directMessage('不能再重生点上空放置方块哦~')
}
}
}
)
world.onPlayerJoin(({entity})=>{
entity.player.enable3DCursor=true;
})
world.onPlayerJoin(({ entity }) => {
entity.onVoxelContact(({x,y,z}) => {
if (voxels.getVoxel(x,y,z) == voxels.id('palace_cloud')) voxels.setVoxel(x,y,z,0);
});
});
world.onEntityContact(({ entity, other }) => {
if (!entity.isPlayer || !other.hasTag('传送门')) return;
entity.position.set(125,2,128);
});
world.onEntityContact(({ entity, other }) => {
if (!entity.isPlayer || !other.hasTag('传送门2')) return;
entity.position.set(128,33,128);
});
var fklxlb = ['自然','建筑','色彩','饮料、调料和食物','特殊']
var fklb = [['草地','泥土','水','蜘蛛网','石头','雪','熊掌印雪','木头','合金欢木头(源自合金欢树)','绿叶','叶子_01','叶子_02','叶子_03','叶子_04','叶子_05','叶子_06','金云','岩浆块1','岩浆块2','冰','北极冰','蜂巢_01','蜂巢_02'],
['南瓜灯','动态蓝灯','古灯','电视','普通玻璃','宫窗','窗户','石砖','花纹砖块','星星窗','礼物(红)','礼物(蓝)','木板','深色木板','装钉木板1','装钉木板2','金属转','绿砖','蓝砖','工具箱','花纹木板_01','花纹木板_02','花纹木板_03','传送带','蹦床','超级蹦床','宝箱','红色屋檐','蓝色屋檐','绿色屋檐','黄色屋檐','宫殿屋檐','木箱子','书架'],
['纯白','柠檬黄','灰蓝','天蓝','橄榄绿'],
['南瓜','蛋糕','草莓汁','酸橙汁','蓝莓汁','葡萄汁','橙汁','牛奶','酱油','咖啡','桃子汁','糖果','饼干'],
['固体加速','液体加速']];
var zwlb = ['门(方向1)','门(方向2)','门(方向3)','门(方向4)','木制天窗(下方)','木制天窗(上方)','花盆','方格楼梯(方向1)','方格楼梯(方向2)','方格楼梯(方向3)','方格楼梯(方向4)','方格台阶'];
var zdlb = ['建房炸弹(一次性用,用完后要再次切换)','大型建房炸弹(一次性用,用完后要再次切换)','超大型建房炸弹(一次性用,用完后要再次切换)','建水池炸弹(一次性用,用完后要再次切换)','大型建水池炸弹(一次性用,用完后要再次切换)','建喷泉水池炸弹(一次性用,用完后要再次切换)'];
var djlb = ['瞬间移动器(右键瞬移)','火把','粒子TNT(右键引燃,4秒后爆炸,纯数粒子特效)','方块旋转器','大水桶(禁用)','吸水器','烟花','冲天炮(连人带炮原地起飞)','幸运方块','爱心烟花','岩浆桶','下界传送门激活器(右键传送门的岩浆块1)(下界传送门:一根柱子,从下往上依次是 岩浆块1 草莓汁 草莓汁 岩浆块2)']
//
//切换方块
// 先在场景中放置一个名称为 切换方块 的实体。
const npc = world.querySelector('#FunctionBlock-1');
npc.enableInteract = true; // 允许进行互动
npc.interactRadius = 1000; // 实体的互动范围
npc.interactHint = '切换方块器(电脑版按E,手机、平板点我丫)'; // 互动提示框显示实体的名称
npc.interactColor = new Box3RGBColor(1,0,0); // 互动提示的文字颜色
// 玩家与实体进行交互时触发
npc.onInteract(async({entity}) => {
const result = await entity.player.dialog({
title: npc.id,
type: Box3DialogType.SELECT,
title: "换啥类型?",
titvarextColor: new Box3RGBAColor(0, 0, 0, 1),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
content: `${entity.player.name},请选择你切换的类型`,
options: ['方块类','杂物类','建筑炸弹类(需要有3级管理员才能使用)','道具区'], // 将提供玩家选择的选项放入数组里。
contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
if (!result || result === null){
entity.player.directMessage('你取消了选择类型');
return;
}
if (result.index == 0)
{
const result1 = await entity.player.dialog({
type: Box3DialogType.TEXT,
title: "方块类型区",
type: Box3DialogType.SELECT,//对话类型是选项
type: Box3DialogType.SELECT,
title: "换啥类型的方块?",
titvarextColor: new Box3RGBAColor(0, 0, 0, 1),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
content: `${entity.player.name},请选择你切换的方块类型`,
options: fklxlb, // 将提供玩家选择的选项放入数组里。
contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
if (!result1 || result1 === null){
entity.player.directMessage('你取消了切换方块类型');
return;
}
entity.player.fklx = result1.index;
entity.player.directMessage('你切换了' + fklxlb[result1.index] + '类');
//方块
const result2 = await entity.player.dialog({
type: Box3DialogType.TEXT,
title: "方块区",
type: Box3DialogType.SELECT,//对话类型是选项
type: Box3DialogType.SELECT,
title: "换啥方块?",
titvarextColor: new Box3RGBAColor(0, 0, 0, 1),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
content: `${entity.player.name},请选择你切换的方块`,
options: fklb[result1.index], // 将提供玩家选择的选项放入数组里。
contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
if (!result2 || result2 === null){
entity.player.directMessage('你取消了切换方块');
return;
}
entity.player.kf = result2.index;
entity.player.zw = -1;
entity.player.dj = -1;
entity.player.directMessage('你切换了' + fklb[result1.index][result2.index] + '方块');
}
else if (result.index == 1)
{
const result1 = await entity.player.dialog({
type: Box3DialogType.TEXT,
title: "杂物区",
type: Box3DialogType.SELECT,//对话类型是选项
type: Box3DialogType.SELECT,
title: "换啥杂物?",
titvarextColor: new Box3RGBAColor(0, 0, 0, 1),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
content: `${entity.player.name},请选择你切换的杂物`,
options: zwlb, // 将提供玩家选择的选项放入数组里。
contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
if (!result1 || result1 === null){
entity.player.directMessage('你取消了切换杂物');
return;
}
entity.player.zw = result1.index;
entity.player.dj = -1;
entity.player.directMessage('你切换了' + zwlb[result1.index]);
}
else if (result.index == 2)
{
const result1 = await entity.player.dialog({
type: Box3DialogType.TEXT,
title: "建筑炸弹区(材质为选择的方块)",
type: Box3DialogType.SELECT,//对话类型是选项
type: Box3DialogType.SELECT,
title: "换啥炸弹?",
titvarextColor: new Box3RGBAColor(0, 0, 0, 1),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
content: `${entity.player.name},请选择你切换的炸弹`,
options: zdlb, // 将提供玩家选择的选项放入数组里。
contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
if (!result1 || result1 === null){
entity.player.directMessage('你取消了切换炸弹');
return;
}
entity.player.kg = result1.index + 1;
entity.player.directMessage('你切换了' + zdlb[result1.index]);
}
else if (result.index == 3)
{
const result1 = await entity.player.dialog({
type: Box3DialogType.TEXT,
title: "道具区",
type: Box3DialogType.SELECT,//对话类型是选项
type: Box3DialogType.SELECT,
title: "换啥道具?",
titvarextColor: new Box3RGBAColor(0, 0, 0, 2),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
content: `${entity.player.name},请选择你切换的道具`,
options: djlb, // 将提供玩家选择的选项放入数组里。
contentTextColor: new Box3RGBAColor(0, 0, 0, 2),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
if (!result1 || result1 === null){
entity.player.directMessage('你取消了切换道具');
return;
}
entity.player.dj = result1.index;
entity.player.zw = -1;
entity.player.directMessage('你切换了' + djlb[result1.index]);
}
});
world.onPlayerJoin(({ entity }) => {
if (entity.player.name == '@拆迁老八') entity.position.set(128,1000000,128);
});
world.onPlayerJoin(({ entity }) => {
entity.player.onPress(({ button, raycast:{ hitEntity, direction, attacker,player,color } }) => {
if (button !== 'action0' || !hitEntity || !TEST_PLAYER.includes(entity.player.name) || entity.player.a != 1) {return;}
hitEntity.velocity.y += 1;
hitEntity.scale = 0;
hitEntity.runSpeed = 0;
hitEntity.walkSpeed = 0;
hitEntity.player.spawnPoint = new Box3Vector3(0, 100000000, 0);
hitEntity.position.set(0,10000000,0);
})
})
world.onChat(({ entity,other,entity:user, message }) => {
if (message === '开启高速模式' && glypd(1,entity)) {
entity.player.walkSpeed = 0.7;
entity.player.walkAcceleration = 1;
entity.player.runSpeed = 1.2;
entity.player.runAcceleration = 1.5;
entity.player.flySpeed = 10;
entity.player.flyAcceleration = 5;
}else if (message === '关闭高速模式' && glypd(1,entity)) {
entity.player.walkSpeed = 0.22;
entity.player.walkAcceleration = 0.19;
entity.player.runSpeed = 0.4;
entity.player.runAcceleration = 0.35;
entity.player.flySpeed = 2;
entity.player.flyAcceleration = 2;
}else if (message[0] === '放' && message[1] === '大' && message[message.length - 1] === '倍' && glypd(1,entity)) {
entity.player.scale = message.slice(2, message.length - 2);
}else if (message === '开启穿墙模式' && glypd(1,entity)) {
entity.player.spectator = true;
}else if (message === '关闭穿墙模式' && glypd(1,entity)) {
entity.player.spectator = false;
}else if (message === '恢复大小' && glypd(1,entity)) {
entity.player.scale = 1;
}else if (message === '补天' && glypd(2,entity)) {
for (var x = 0;x <= 256;x++)
for (var z = 0;z <= 256;z++)
{{
voxels.setVoxel(x, 62, z,entity.player.fk[entity.player.fklx][entity.player.kf]);
}}
}else if (message === '取消' && TEST_PLAYER.includes(entity.player.name)) {
entity.player.a = 0;
}else if (message === '重置' && glypd(2,entity)) {
cubefill('dirt',0,0,0,256,7,256);
cubefill('grass',0,8,0,256,1,256);
cubefill(0,0,9,0,256,256,256);
}else if (message === '地面清理' && glypd(3,entity)) {
for (var x = 0;x <= 256;x++)
for (var y = 0;y <= 64;y++)
{{{
voxels.setVoxel(x, y, z,0);
}}}
for (var x = 0;x <= 256;x++)
for (var y = 0;y <= 7;y++)
for (var z = 0;z <= 256;z++)
{{{
voxels.setVoxel(x, y, z,'dirt');
}}}
for (var x = 0;x <= 256;x++)
for (var z = 0;z <= 256;z++)
{{
voxels.setVoxel(x, 8, z,'grass');
}}
for (var x = 123;x <= 132;x++)
for (var z = 123;z <= 132;z++)
{{
voxels.setVoxel(x, 9, z,'ice_brick');
}}
}else if (message === '服务器崩溃' && glypd(2,entity))
{
while(1)
{
entity.player.forceRespawn();
}
}else if (message === '填地' && glypd(2,entity))
{
for(var x = 0; x<=256; x++)
{
for(var z=0; z<=256; z++)
{
for(var y=0; y<=7; y++)
{
voxels.setVoxel(x, y, z, 'dirt');
}
}
}
}else if (message === '换春天地板' && glypd(1,entity))
{
for(var x = 0; x<256; x++)
{
for(var z=0; z<256; z++)
{
voxels.setVoxel(x, 8, z, 'grass');
}
}
}else if (message === '换蹦床地板' && glypd(1,entity))
{
for(var x = 0; x<256; x++)
{
for(var z=0; z<256; z++)
{
voxels.setVoxel(x, 8, z, 'bounce_pad');
}
}
}else if (message === '换传送带地板' && glypd(1,entity))
{
for(var x = 0; x<256; x++)
{
for(var z=0; z<256; z++)
{
voxels.setVoxel(x, 8, z, 'conveyor');
}
}
}else if (message === '换坚硬地板' && glypd(1,entity))
{
for(var x = 0; x<256; x++)
{
for(var z=0; z<256; z++)
{
voxels.setVoxel(x, 8, z, 'ice_brick');
}
}
}else if (message === '换水源地板' && glypd(1,entity))
{
for(var x = 0; x<256; x++)
{
for(var z=0; z<256; z++)
{
voxels.setVoxel(x, 8, z, 'water');
}
}
for(var x = 0; x<256; x++)
{
for(var z=0; z<256; z++)
{
voxels.setVoxel(x, 7, z, 'ice_brick');
}
}
}else if (message === '换夏天地板' && glypd(1,entity))
{
for(var x = 0; x<=256; x++)
{
for(var z=0; z<=256; z++)
{
voxels.setVoxel(x, 8, z, 'windygrass');
}
}
}else if (message === '换秋天地板' && glypd(1,entity))
{
for(var x = 0; x<=256; x++)
{
for(var z=0; z<=256; z++)
{
voxels.setVoxel(x, 8, z, 'yellow_grass');
}
}
}else if (message === '换冬天地板' && glypd(1,entity))
{
for(var x = 0; x<=256; x++)
{
for(var z=0; z<=256; z++)
{
voxels.setVoxel(x, 8, z, 'snowland');
}
}
}else if (message === '换月球地板' && glypd(1,entity))
{
for (var x = 0;x <= 256;x++)
for (var y = 0;y <= 7;y++)
for (var z = 0;z <= 256;z++)
{{{
voxels.setVoxel(x, y, z,'dark_surface');
}}}
for (var x = 0;x <= 256;x++)
for (var z = 0;z <= 256;z++)
{{
voxels.setVoxel(x, 8, z,'purple_surface_01');
}}
}else if (message === '换air地板' && glypd(1,entity))
{
for (var x = 0;x <= 256;x++)
for (var y = 0;y <= 7;y++)
for (var z = 0;z <= 256;z++)
{{{
voxels.setVoxel(x, y, z,'air');
}}}
for (var x = 0;x <= 256;x++)
for (var z = 0;z <= 256;z++)
{{
voxels.setVoxel(x, 8, z,'air');
}}
}else if (message[0] === '集' && message[1] === '体' && glypd(3,entity))
{
var numm = 0;
for (var i = 2;i <= message.length - 1;i++)
{
if (message[i] == '/')
{
numm = i;
break;
}
}
jtcz(message.slice(numm + 1, message.length));
}else if (message[0] === '查' && message[1] === '找' && glypd(3,entity))
{
var numm = 0;
for (var i = 2;i <= message.length - 1;i++)
{
if (message[i] == '/')
{
numm = i;
break;
}
}
cz(message.slice(2, numm),message.slice(numm + 1, message.length));
}else if (message[0] === '时' && message[1] === '间' && glypd(1,entity))
{
var num = message.slice(message.length - 2, message.length) / 60 * (0.25 / 12);
var num1 = message.slice(2, message.length - 3) * (0.25 / 12);
world.sunPhase = (num1 + num);
}
if (message === '第一人称')
{
entity.player.cameraMode='fps';
}
else if (message === '第三人称')
{
entity.player.cameraMode='follow';
}
else if (message === '看不见路的人称')
{
entity.player.cameraMode='fixed';
}
else if (message === '申请管理员' || message === '我要当管理员' || message === '作者,我要当管理员')
{
world.say('管理员人数过限了,不能申请了')
}
else if (message === '有bug')
{
entity.player.directMessage("如有bug请在评论反馈")
}
else if (message ==='重置2')
{
while(1)
{
entity.player.forceRespawn();
}
}else if (message === '开启第1379行代码' && glypd(3,entity))
{
world.say('以开启第1379行代码')
entity.player.cameraMode='fixed';
}else if (message === '解封' && glypd(3,entity))
{
world.say('以开启解封模式')
entity.player.spawnPoint = new Box3Vector3(128, 13, 128);
entity.player.scale = 0.8;
entity.player.canFly = true;
entity.player.walkSpeed = 0.22;
entity.player.runSpeed = 0.4;
entity.position.set(128, 13, 128);
}
else if (message === '开启连锁拆卸' && glypd(2,entity))
{
entity.player.ls = 1;
}
else if (message === '关闭连锁拆卸' && glypd(2,entity))
{
entity.player.ls = 0;
}
else if (message[0] == '切' && message[1] == '换')
{
if (message.slice(2, message.length) == 'ice_brick') {entity.player.directMessage('不能用建台子用的方块哦');}
else
{
entity.player.kf = -2;
entity.player.zw = -1;
entity.player.dj = -1;
entity.player.zdfk = message.slice(2, message.length);
entity.player.directMessage('你切换了' + message.slice(2, message.length))
}
}
else if (message === '开启快速填充' && glypd(3,entity))
{
entity.player.jz = 1;
entity.player.directMessage('已开启快速填充模式')
}
else if (message === '开启平面快速填充' && glypd(3,entity))
{
entity.player.jz = 2;
entity.player.directMessage('已开启平面快速填充模式(自动判断方向,不过有点不智能)')
}
else if (message === '关闭快速填充' && glypd(3,entity))
{
entity.player.jz = 0;
entity.player.directMessage('已关闭快速填充模式')
}
else if (message === '开启快速填色' && glypd(3,entity))
{
entity.player.jz = 3;
entity.player.directMessage('已开启快速填色模式')
}
else if (message === '开启平面快速填色' && glypd(3,entity))
{
entity.player.jz = 3;
entity.player.directMessage('已开启平面快速填色模式')
}
else if (message === '关闭快速填色' && glypd(3,entity))
{
entity.player.jz = 0;
entity.player.directMessage('已关闭快速填色模式')
}
else if (message === '加速'){
entity.player.flySpeed = 20;
entity.player.runSpeed = 30;
entity.player.walkSpeed = 20;
entity.player.swimSpeed = 20;
}
else if (message === '方块列表' || message === '全部方块' || message === 'block')
{
lb = voxels.VoxelTypes;
for (var i = 0;i < lb.length;i += 2)
{
if (i + 1 < lb.length)
{
block = lb[i] + "," + lb[i + 1];
}
else
{
block = lb[i];
}
entity.player.directMessage(block);
}
}
else if (message == "开启自动跳跃")
{
entity.player.zdty = 1;
}
else if (message == "关闭自动跳跃")
{
entity.player.zdty = 0;
}
for (i = 0;i < message.length - 1;i++)
{
if (message[i] == "杰" && message[i + 1] == "哥")
{
entity.position.set(128,100000,128);
}
else if (message[i] == "阿" && message[i + 1] == "伟")
{
entity.position.set(128,100000,128);
}
else if (message[i] == "尼" && message[i + 1] == "玛")
{
entity.position.set(128,100000,128);
}
}
});
world.onChat(({ entity, message }) => {
if (entity && entity.isPlayer) {
if (message[0] === '%') {
if (glypd(3,entity)){
entity.player.directMessage(message.slice(1, message.length - 8) + '~>');
world.querySelectorAll('player').forEach((entity)=>{
if (entity.player.name == message.slice(2, message.length - 9))
{
entity.position.set(128,10000000000,128);
entity.player.spawnPoint = new Box3Vector3(0, 10000000, 0);
}
})
}
};
}
});
world.onChat(({ entity, message }) => {
if (entity && entity.isPlayer) {
if (message[0] === '/') {
if (glypd(3,entity)) {
entity.player.directMessage(message.slice(1, message.length - 8) + '~>');
try
{
eval(message.slice(1, message.length));
} catch (error) {
entity.player.directMessage('Error:' + error);
};
} else {
entity.player.directMessage('<~你不是管理员!');
};
};
}
});
world.onPlayerJoin(async({entity})=>
{
entity.onVoxelContact(async({entity,voxel,force})=>{
if (voxel==voxels.id('palace_floor')){
entity.velocity.y+=force.y * 1 - 0.0001;
entity.velocity.x+=force.x * 1 - 0.0001;
entity.velocity.z+=force.z * 1 - 0.0001;
}
if (voxel==voxels.id('carpet_01')){
entity.player.runSpeed = 20;
entity.player.walkSpeed = 10;
}
if (voxel!=voxels.id('carpet_01')){
entity.player.runSpeed = 0.4;
entity.player.walkSpeed = 0.22;
}
});
});
// voxels.setVoxel(128,3,128,'lantern_02')
// world.onFluidEnter(async({entity,voxel})=>{
// if (voxel==voxels.id('blueberry_juice')){
// entity.position.set(128,3,128);
// }
// });
world.onVoxelContact(({ entity, voxel, axis }) => {
if (!entity.isPlayer) return;
const voxelName = voxels.name(voxel);
if ((axis.x == 1 || axis.z == 1 || axis.x == -1 || axis.z == -1) && (entity.player.walkState == Box3PlayerWalkState.WALK || entity.player.walkState == Box3PlayerWalkState.RUN) && entity.player.zdty == 1)
{
entity.velocity.y = 0.6;
}
});
world.onPlayerJoin(async({entity})=>
{
if (entity.player.boxId == 'FfswKYzvwz7nKbf' || entity.player.boxId == 'tiFTHzHkBo5UKTN' || entity.player.boxId == 'jGNZf7G0t0Cc3zC'){
entity.player.directMessage('拉黑中')
entity.player.scale = 0;
entity.player.hp = 0;
entity.player.walkSpeed = 0;
entity.player.runSpeed = 0;
entity.player.swimSpeed = 0;
entity.position.set(0,1000000,0);
}
entity.onFluidEnter(({entity, voxel}) => {
if (voxel==voxels.id('lemon_juice')){
entity.player.swimSpeed = 100;
}
if (voxel!=voxels.id('lemon_juice')){
entity.player.swimSpeed = 0.4;
}
})
});
function zx(code)
{
// if (code.slice(1, 7) == 'bhouse(')
// {
// for (i = 8;i <= code.length - 1)
// }
world.say('正在研发中……')
}
world.onChat(async({ entity, message }) => {
if (entity && entity.isPlayer){
if (message=='~!~!~'){
const result4 = await entity.player.dialog({
type:Box3DialogType.INPUT,
title:'控制台',
content:'请输入指令(指令有:\n1、bhouse(xsize(<=30),ysize(<=30),zsize(<=30))\n例如:bhouse(10,20,10)\n\n2、bpool(radius(<=10)例如bpool(5)\n\n3、plae(attribute,size(<=10))\n例如:plae(scale,5)\n可用的attribute有:sacle、runSpeed、walkSpeed、flySpeed、swimSpeed、jumpPower)',
confirmText:'执行',
placeholder:'输入指令',
})
if (!result4){entity.player.directMessage('以取消指令');return}
try{
zx(result4);
}catch(err){
await entity.player.dialog({
type:Box3DialogType.TEXT,
title:'控制台',
content:'Error:'+err,
})
}
}
}
})
world.onChat(async({ entity, message }) => {
if (entity && entity.isPlayer){
if (glypd(3,entity)){
if (message=='!~!'){
const result4 = await entity.player.dialog({
type:Box3DialogType.INPUT,
title:'控制台',
content:'请输入代码',
confirmText:'执行',
placeholder:'输入代码',
})
if (!result4){entity.player.directMessage('以取消代码');return}
try{
// eval(result4);
await entity.player.dialog({
type:Box3DialogType.TEXT,
title:'控制台',
content:'<~ '+eval(result4),
})
}catch(err){
await entity.player.dialog({
type:Box3DialogType.TEXT,
title:'控制台',
content:'Error:'+err,
})
}
}
}
}
})
来自神奇代码岛
最新推荐文章于 2024-11-15 18:38:47 发布