Last active
February 14, 2019 08:14
-
-
Save NielsPilgaard/815be58df2f606184a01b64a141025f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#priority 100 | |
import mods.manatweaks.ManaHandler; | |
import crafttweaker.player.IPlayer; | |
import crafttweaker.entity.IEntity; | |
import crafttweaker.entity.IEntityEquipmentSlot; | |
import crafttweaker.event.PlayerTickEvent; | |
import crafttweaker.item.IItemStack; | |
events.onPlayerTick(function(event as PlayerTickEvent){ | |
var player = event.player; | |
var mainhand = crafttweaker.entity.IEntityEquipmentSlot.mainHand(); | |
if (!isNull(player.currentItem)) { | |
print("Current item: " ~ player.currentItem.displayName); | |
if (player.currentItem.matches(<buildinggadgets:buildingtool:*>.withTag({}))) { | |
player.manaRepairSlot(mainhand, 10, 1); | |
//<buildinggadgets:buildingtool:*>.manaRepair(player, 10, 1); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment