Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import crafttweaker.block.IBlock;
- import crafttweaker.block.IBlockDefinition;
- import crafttweaker.event.BlockBreakEvent;
- import crafttweaker.events.IEventManager;
- import crafttweaker.item.IItemStack;
- import crafttweaker.player.IPlayer;
- //test
- //if player is not holding axe, chest is unbreakable
- events.onBlockBreak(function(event as crafttweaker.event.BlockBreakEvent){
- if (event.block==(<minecraft:chest>)){
- if (!event.player.currentItem.matches(<ore:toolAxe>)) {
- event.cancel();
- if (event.world.remote) {
- event.player.sendChat("You need an axe to break this item.");
- }
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment