#loader crafttweaker reloadableevents
//导包
import crafttweaker.item.IItemStack;
import crafttweaker.player.IPlayer;
import crafttweaker.event.BlockHarvestDropsEvent;
events.onBlockHarvestDrops(function(event as BlockHarvestDropsEvent) {
//定义变量
var player as IPlayer = event.player;
//基本逻辑判断,不符合则跳过
if(!event.isPlayer || event.drops.length == 0 || event.silkTouch) return;
//因为drops是一个数组,原木破坏也只有一个,所以我们取它的第一位元素进行判断
if(<ore:logWood>.matches(event.drops[0].stack)){
if(isNull(player.currentItem) || !(player.currentItem.toolClasses has "axe")){
event.drops = [];
player.sendChat("无 树 可 撸");
}
}
});
//判断如下:
if(player.isFake()) return;