supersaiyansubtlety

block_drops.zs

Feb 6th, 2020
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import crafttweaker.events.IEventManager;
  2. import crafttweaker.event.BlockHarvestDropsEvent;
  3. import crafttweaker.item.IItemStack;
  4. import crafttweaker.item.WeightedItemStack;
  5. import crafttweaker.block.IBlockPattern;
  6. import crafttweaker.block.IBlock;
  7. import crafttweaker.block.IBlockDefinition;
  8. import scripts.statics.leafVariants;
  9.  
  10.  
  11. events.onBlockHarvestDrops(function(event as BlockHarvestDropsEvent)
  12. {
  13. var leafDblSlabs as IBlockDefinition [] = [ <minecraft:double_wooden_slab:2>.asBlock().definition ];
  14.  
  15. if((leafVariants has event.block.definition)
  16. | (leafDblSlabs has event.block.definition)
  17. )
  18. {
  19. if(!isNull(event.player) && !isNull(event.player.currentItem))
  20. {
  21. if (event.player.currentItem.definition.id == <minecraft:shears>.definition.id) { return; }
  22. if (!isNull(event.player.currentItem.enchantments))
  23. {
  24. for enchantment in event.player.currentItem.enchantments { if(enchantment.definition == <enchantment:minecraft:silk_touch>) { return; } }
  25. }
  26. }
  27. event.drops = [] as WeightedItemStack[];
  28. }
  29. return;
  30. });
Advertisement
Add Comment
Please, Sign In to add comment