My plugin works but there is an error in the console when ever I click a creeper without a "lightning rod" Error: https://pastebin.com/ha7GQrWB Code: https://pastebin.com/2XALR7V5
Its because if you dont have the lightning rod (or another item with a custom name) getDisplayName will return null and error.
so if i make another if statement before checking if it dosent have item meta it should fix? EDIT: Nevermind i just added a check to see if it has itemmeta before
Don't check just for meta because that could be lore in which case the error would still fire. You can still get the item meta if all of it's aspects are null so check specifically if it has a displayname before checking what the dn is.