Created
July 7, 2017 21:20
-
-
Save TheXFactor117/0061b53bb05b1fd3c37e8382585210ae 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
@SubscribeEvent | |
public void onPlayerTick(PlayerTickEvent event) | |
{ | |
if (!event.player.getEntityWorld().isRemote) | |
{ | |
if (event.phase == Phase.START) | |
{ | |
for (ItemStack stack : event.player.inventory.mainInventory) | |
{ | |
if (stack != null && stack.getItem() instanceof ItemSword) | |
{ | |
NBTTagCompound nbt = NBTHelper.loadStackNBT(stack); | |
if (nbt != null && !nbt.hasKey("Level")); | |
{ | |
ItemGenerator.createWeapon(stack, event.player); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment