Closed Formula350 closed 7 years ago
This is a known error that is not caused by OldCombatMechanics, but by plugins/users not following the NBT tag conventions. You can find more information and a potential solution on issue #57
So if, say, I have a completely clear inventory, no armor of off-hand, and I run: /i Elytra 1 /enchant unbreaking 50 and the error starts to occur, it means that EssentialsX is to blame?
I'm not sure how EssentialsX adds enchantments to items, but the problem could have to do with the fact that an elytra is not meant to have such an enchantment. It may be possible to enchant the elytra with a different plugin or even directly use a minecraft command to give it the correct value type, like shown in issue #57 .
I'll give that a shot, using vanilla MC command /minecraft:enchant
and let you know if the Events issue(s) persist.
Alright I'm not able to tell what the difference is between these two items using NBTExplorer, but they were both created (once upon a time) using the exact some /minecraft:give command (see below), but one was given in 1.8 and sat in my KPack backpack (flat-file) but later taken out in 1.11, and one was given fresh in 1.11...
The one taken from the backpack (thus, created in 1.8) is the one that causes the errors. The other, does not. Here they are... THIS one DOES cause errors: https://s3.amazonaws.com/files.enjin.com/510245/Weird_Chestplate.schematic THIS one does NOT cause errors: https://s3.amazonaws.com/files.enjin.com/510245/Fine_Chestplate.schematic
Command:
/minecraft:give Formula350 minecraft:diamond_chestplate 1 0 {HideFlags:6, AttributeModifiers:[{AttributeName:"generic.knockbackResistance",Name:"generic.knockbackResistance",Amount:0.10,Operation:1,UUIDLeast:522823,UUIDMost:992027,Slot:"torso"},{AttributeName:"generic.attackDamage",Name:"Increased Damage",Amount:0.02,Operation:1,UUIDLeast:601093,UUIDMost:276433},{AttributeName:"generic.attackSpeed",Name:"Attack Speed",Amount:0.05,Operation:1,UUIDLeast:408956,UUIDMost:813347,Slot:"torso"},{AttributeName:"Luck",Name:"generic.luck",Amount:7,Operation:0,UUIDLeast:302411,UUIDMost:928010,Slot:"torso"}],Unbreakable:1,display:{Name:"§7§lƝ§8§lƴ§9§lχ§7’ѕ §f§oNightgown",Lore:["§7Knockback Resistance +10%", "§7Attack Speed +5%", "§7Increase Damage +2%", "§7Luck +7", "§9Unbreakable", "§f§lType: §7Diamond Chestplate", "§f§lTier: §9Primeval", "§e§o''''Nyx takes no chances when she goes", "§e§oto bed, wearing a nightly attire of power", "§e§othat rivals that of the strongest", "§e§oheroes'' combat gear!''''", "§9(Socket)", "§9(Socket)", "§9(Socket)", "§9(Socket)", "§9(Socket)", "§7Find a §6Socket Gem§7 to fill a §9(Socket)"]},ench:[{id:0,lvl:7},{id:2,lvl:2}]}
This page has more information of the NBT tags: https://minecraft.gamepedia.com/Player.dat_format
I'm not sure if it's related, but it says this about the ID in the item structure:
id: Item/Block ID (This is a Short tag prior to 1.8.) If not specified, Minecraft changes the item to stone (setting ID to 1 and Damage to 0, and ignoring any existing Damage value) when loading the chunk or summoning the item.
Or maybe it's a UUIDMost or UUIDLeast of an AttributeModifier, also described in the page.
Seems to be the latter, not that any of that makes a particle of sense to me! :P The UUID tags on items were never something I looked into and my only interaction with them has been the slots I leave blank/default on the MCStacker site (where I conjured up that command originally).
Nevertheless, those were the TWO that I didn't bother to look at and is indeed where the UUID difference is:
So the question becomes, and I don't mean for this to come out as if I'm being a dick: When it's a vanilla MC hiccup, how does the problem come down to the server owner/players when they've not done anything? 😕
Well, you see, the piece of code on which the error is occurring is the following:
return new UUID(data.getLong("UUIDMost", null), data.getLong("UUIDLeast", null));
we are trying to get the UUIDMost and UUIDLeast as Longs. The error is telling us that they're actually integers.
But they shouldn't be integers, they should be longs. In the screenshot you just sent you can see next to both UUIDs the icon with the letter L, which means that it is a long. The actual content of the UUID is not what is causing the problem. Therefore, the tags you show here should not be the ones causing the problems. It could be some of the other of the 6 entries under "AttributeModifiers". Check the data type of the entries' UUIDLeast and UUIDMost.
Hmm alright.
If that's the case though, why wouldn't the other 4 Attributes, whose UUIDs are all Integer
instead of Long
, cause that to break the one that works fine?
There are 4 differences overall between those two schematics, one of which is irrelevant in this context since it's simply the Coordinates of the Chest the items were in (in hindsight I should've put it in the same chest):
Chest Coordinates
Attribute 5 generic.armor
's UUID Least/Most value
Attribute 6 generic.armorToughness
's UUID Least/Most value
Attribute 6 generic.armorToughness
's Amount Value
Which I find interesting because Attribute 6 is the one OCM modified to 9999
(not sure how I missed that the first time...). I'd have shown more but I've maxed out what 1080p can display 😛
Alright... so I have added a compatibility method to the newest test build which when operating on UUIDMost or UUIDLeast first tries with Long, then with Integer, and only in the case that it's neither throws an error. This is so even items not following NBTTag convention can still work.
Please try it out to check if I've implemented something wrong or the approach simply doesn't work.
As far as I can tell the issue is resolved. There are no longer errors that show up in console upon world change, join, or quit. I used both of the above chestplates, changed worlds, disconnected, re-joined, all error-free.
Just to be thorough, even if I didn't expect it would solve the other issue(s), it didn't make any difference to the RPGItem sword's Sweep not being blocked by OCM. A vanilla sword with vanilla damage continues to be block.
Thank you for addressing this! 😄 -Form
(I'll assume you can re-open closed tickets, should you have preferred it remain open, but I'll close this since the issue has technically be solved.)
Spigot 1.11.2 (the "-twkd" only indicates the .conf being used with tweaked Java Args) OCM v1.6.2 build 58, 60, potentially 1.6.1 (also 1.1.2 & 1.4.2, but I thought they were erroring due to age) EssentialsX v2.0.1 build 530 ProtocolLib v4.3.0 build 386 MultiVerse v2.6.0 build 736
<many others of unknown relevance>
Does this by chance have anything to do with having an Elytra equipped (and/or just in my inventory) that has a level 50 Unbreaking Enchantment? As I know that "Unsafe Enchantments" can cause odd things to happen, but I'm not sure if it would in this instance since it provides no armor value.
First Error: PlayerJoinEvent
Second Error: PlayerQuitEvent
Third Error: PlayerChangeWorldEvent
Fourth Error: ArmourEquipEvent (/kp is for the plugin KPack and is a Backpack plugin, stores data in Flat Files. I can only assume that the multiple, uninterrupted errors were a result of me adding/removing items from my backpack's inventory. I've included them all incase there's some small nuance that I've missed that is different between them all)
Unfortunately I'll be away this weekend until Monday, but will TRY to check back if I can and answer any questions there may be. Thanks -Formula350
<>
--- CONFIG FILE ---