Is there a way to register a new enchantment? Im trying to make a customenchantment and I dont want to use getCustomName().
To register a new one you'd have to edit Enchantment.php from PMMP SRC. I would prefer using setCustomName() and then let EntityDamageEvent to act according to your need!
Well the only problem with getCustomName, it requires so much code just to check if the item has/doesnt have a custom name then the enchant
Is this hard? PHP: $item->setCustomName("Killer\n50% nausea chance"); // EGOn EntityDamageEvent$h = $player->getInventory()->getItemInHand();if($h->getCustomName("Killer\n50% nausea chance")) { // Just copy and paste//code }
Yes, because im setting up a system where players can add any enchant to there item name no matter what the name,
That's something you'd need to switch. Maybe, you could call hasEnchantments(); Maybe my plugin could help you : https://github.com/RTGNetworkkk/Cus...lob/master/src/RTG/CE/CustomEnchants.php#L242
Maybe it's really better if you just define the name without unnecessary codes. PHP: if($it->getName() === "\nTest1") {}
no this doesnt work causeit thinks the name is just "\nTest1", so if it had another name, it would work
Because it is not systematic to change the names properly? And what the **** is that `if($h->getCustomName("blah"))`?
Hacks Hacks not gonna talk about it to somebody who doesn't know what it exactly is to prevent misuse, but if you really want that to happen, take a look at http://PHP.net/reflections