本帖最后由 Thiocyanate 于 2016-2-2 13:03 编辑
嫌原版里面的按钮和踏板太难看了?这次我帮你解决!
这次主要介绍如何制作新的按钮与踏板
踏板:
1.JS文件,不用说的,当然是blocks
2.输入下列代码:
/*DiamondPlate.js*/
name = "DiamondPlate";
material = "rock";
stepSound = "stone";
hardness[0] = 0;
drop[0] = "Creator:DiamondPlate";
addToCreative[0] = true;
trigger = "all";
textureFileYN[0] = "exampleImage.png";
3.代码讲解:
trigger这个属性定义了对象可以触发的压力板。属性是包含和不包括实体或实体类的组合。你可以使用实体名称(爬行者、蜘蛛等),实体的ID(例如爬行者具有ID 50)或以下: - all 所有的
- mobs 怪物
- players 玩家
- hostiles 敌对生物
- animals 动物
- items 物品
你也可以用多个分离的 ','.
示例:
// 默认值
trigger = "include(all)";
trigger = "include(mobs)";
trigger = "include(all) exclude(items,players)";
trigger = "include(hostiles) exclude(Creeper)";
4.脚本设置:
因为是踏板,所以蓝框里面要输入pressurePlate
5.可以打开游戏了~~~
按钮:
1.JS文件,不用说的,当然是blocks文件夹里面
2.输入下列代码:
/*DiamondButton.js*/
name = "DiamondPlate";
material = "rock";
stepSound = "stone";
drop[0] = "Creator:DiamondPlate";
addToCreative[0] = true;
toolClass[0] = "pickaxe";
harvestLevel[0] = 3;
hardness[0] = 30;
isSensible = true;
textureFileXP[0] = "/diamond_block.png";
textureFileXN[0] = "/diamond_block.png";
textureFileYP[0] = "/diamond_block.png";
textureFileYN[0] = "/diamond_block.png";
textureFileZP[0] = "/diamond_block.png";
textureFileZN[0] = "/diamond_block.png";
3.代码讲解:
isSensible这个属性定义了按钮可以由弓箭触发.输入true或false 示例
isSensible = true;
// 默认值
isSensible = false;
4.脚本设置:
因为是按钮,所以要输入button
5.可以打开游戏了~~
就是不知道为什么踏板踩不了
下次就介绍新的梯子和门,后面还有很多
初始页地址,有教程目录:http://www.zuimc.com/thread-39587-1-1.html |