Skip to content

Instantly share code, notes, and snippets.

@NielsPilgaard
Last active February 14, 2019 08:14
Show Gist options
  • Save NielsPilgaard/815be58df2f606184a01b64a141025f9 to your computer and use it in GitHub Desktop.
Save NielsPilgaard/815be58df2f606184a01b64a141025f9 to your computer and use it in GitHub Desktop.
#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