Advertisement
TrashboxBobylev

Untitled

Jun 30th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var trait1 = mods.contenttweaker.tconstruct.TraitBuilder.create("torchlight");
  2. trait1.color = 0xffbf00;
  3. trait1.maxLevel = 1;
  4. trait1.countPerLevel = 1;
  5. trait1.onHit = function(trait, tool, attacker, target, damage, isCritical){
  6.     target.setFire(damage);
  7. };
  8.  
  9.  
  10.  
  11. events.onPlayerInteractBlock(function(event as crafttweaker.event.PlayerInteractBlockEvent){   
  12.     var fn = function (item){
  13.         var nbt = item.tag as IData;
  14.         if ((nbt.asMap()) has "Traits"){
  15.             var traits = nbt.memberGet("Traits") as IData;
  16.             if ((traits.asList()) has "torchlight"){
  17.                 return true;
  18.             }
  19.         }
  20.         return false;
  21.     };
  22.     if (event.player.currentItem.only(fn)){
  23.         val material = IBlockState.getBlockState(event.block.definition.id, [""]).material;
  24.         if (material.canBurn){
  25.             server.commandManager.executeCommand(server, "/setBlock " + event.x + " " + event.y + " " + event.z + " minecraft:fire");
  26.         }
  27.     }
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement