Fourmisain / KeepHeadNames

A Fabric/(Neo)Forge Minecraft mod that keeps player head names after placing them down
MIT License
3 stars 0 forks source link

Mod Does Not Keep Lore #5

Open AphoticGoblin opened 3 months ago

AphoticGoblin commented 3 months ago

https://youtu.be/gkGy7lCfbqU

Using the latest version for 1.20.1 Fabric

Fourmisain commented 3 months ago

Hm... I just tested it again and it does keep the lore just fine.

Wait, that video... something weird is happening with the head! At the beginning, the head is called "jeb_'s Head" without italics and the skin has brown/ginger hair. Placed down, it still has the same skin, but the exact moment you start breaking it, the skin immediately changes to a completely different one with white hair with a green leaf headband! That shouldn't be happening even in vanilla. After breaking, the name changed to italics as well, which is not normal with Keep Head Names either.

You must have some other mod or datapack installed that does something to the heads, not sure what.

If you send the mod/datapack list I can take a look. If you want to do some testing yourself, you can disable mods/datapacks until it starts working again and we'll know the last disabled mod/datapack must have been it.

For testing you can give yourself a head with lore via /give @s minecraft:player_head{display:{Name:'{"text":"Some Name","italic":false}',Lore:['[{"text":"Some Lore"}]']}} 1 And you can check the NBT before/after with /data get entity @s SelectedItem

AphoticGoblin commented 3 months ago

The reason it does that is just because it takes time to update and I have bad wifi + I used carpet to spawn jeb in. Using my own head it kept the skin.

Also, I've discovered something very strange. If I use the command you sent, the mod works perfectly fine! This might be because I was testing with a datapack that adds player head decapitation. It's from https://vanillatweaks.net

Here's the json (I modified it a bit for my server)

{
  "type": "minecraft:entity",
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "item",
          "name": "minecraft:player_head",
          "functions": [
            {
              "function": "set_lore",
              "replace": true,
              "lore": [
                [
                  {
                    "text": "§rKilled by §r§e"
                  },
                  {
                    "selector": "@s"
                  }
                ]
              ],
              "entity": "killer_player"
            },
            {
              "function": "fill_player_head",
              "entity": "this"
            }
          ],
          "conditions": [
            {
              "condition": "killed_by_player"
            },
            {
              "condition": "minecraft:entity_scores",
              "entity": "this",
              "scores": {
                "Borderlands": 1
              }
            }
          ]
        }
      ]
    }
  ]
}
Fourmisain commented 3 months ago

The reason it does that is just because it takes time to update and I have bad wifi + I used carpet to spawn jeb in.

But a head without skin would show Steve instead of the ginger head, wouldn't it? Still confused by that one.

Also, I've discovered something very strange. If I use the command you sent, the mod works perfectly fine! This might be because I was testing with a datapack that adds player head decapitation. It's from https://vanillatweaks.net/

Gonna see if I can reproduce the issue using this datapack.

Fourmisain commented 3 months ago

No luck. Removed the condition and spawned jeb in via carpet just like you said. The head retains name and lore when placing and mining as expected (the heads even stack, meaning the NBT is the exact same). test (Btw, about the ginger head - you're right about that, I saw it too, that's the associated default/offline skin for jeb, so it'll use that before loading his actual skin.)

If you want to make testing easier on your end, you can invoke the loot command directly (assuming the condition is true) /loot give @s kill @s

...

Hold on.

Maybe the issue is exactly that the player head was updated while it was placed on the ground! I wouldn't be surprised if the function that replaces the player skin doesn't retain the name and lore nbt at all. Need to look into that.

Fourmisain commented 3 months ago

Hm... it doesn't appear like there's an issue in the vanilla code for 1.20.1, both by reading and testing.

Tried merging in a name onto a placed head with lore, watched the skin update - no issue. /data merge block x y z {SkullOwner: {"Name":"jeb_"}}

Gave myself a player head with lore and immediately placed it, watched the placed head skin update - no issue. /give @s player_head{SkullOwner:AphoticGoblin,display:{Lore:['[{"text":"Some Lore"}]']}} 1 test

So I still think this has to be some kind of mod conflict. To me it looks like something's modifying the dropped player head's name - I can otherwise not explain why the name of the head turns italics. Italics means that it's a display name, not a SkullOwner. Your datapack only fills in the SkullOwner.

Modlist please.

AphoticGoblin commented 3 months ago

Audaki Cart Engine 2.0.6 Additional Additions 6.0.1 AllStackable 2.0.0 Alternate Current 1.7.0 Anti Xray 1.3.1 Apocalypse Origins 0.4.53 Architectury 9.2.14 Banhammer 0.7.1 BE Style Wither 1.6.1 Better Ladders 1.20.x Biome Makeover 1.11.4 Block Swap 5.0.0.0 Blockus 2.7.12 Bookshelf 20.1.10 Bundle Scroll 1.1.0 C2ME 0.2.0+alpha.11.5 Carpet Fixes 1.16.1 Chunk Sending 2.8 Cinderscapes 4.0.10 Cloth Config 11.1.118 Clumps 12.0.0.3 Collective 7.54 Companion 5.1.0 Configurable Regional Difficulty 0.2 https://github.com/Imajo24I/Configurable-Regional-Difficulty/releases/tag/1.20.1-0.2 Convenient Mob Griefing 2.1.0 CoroUtil 1.3.7 Cupboard 2.6 Discord Integration 3.0.7 Ecologics 2.2.0 Every Compat 2.6.53 Experienced Crops 1.1.0 Extra Origins 1.20-8 Fabric Api 0.92.2 Carpet 1.4.112+v230608 Fabric Language Kotlin 1.10.19+kotlin.1.9.23 Fabric Tab 2.0.0 Fast Async World Save 1.9 FerriteCore 6.0.1 Fish On The Line 3.2 Friendly Fire 18.0.5 Friends & Foes 2.0.7 GeckoLib 4.4.4 Glowing Banners 1.3.2 You've Goat to be Kidding Me 1.3.4 Get Off My Lawn ReServed 1.9.4 Universal Graves 3.0.1 Herds Panic 1.1.0 Horse Buff 2.1.2 Insomnia Tracker 1.0.0 Inventory Sorter 1.9.0 InvView 1.4.12 Item Obliterator 2.2.1 Just End Anchor 1.0.2 Keep Head Names (duh) Kiwi 11.6.0 Ledger Let Me Despawn 1.2.0 Linkart 5.4.4 build 1.33 Lithium 0.11.2 Lootr 0.7.31.78 LuckPerms 5.4.102 Map Atlases 6.0.5 Minecraft Command Permissions (for luckperms) ModernFix 5.17.0 Moonlight Lib 2.11.12 More Mob Variants 1.3.0.1 Mineblock's Repeated Utilities 0.4.0 Necronomicon 1.4.2 Neruina 1.3.0 NoChatReports 2.2.2 Noisium 2.0.3 On Soul Fire Orb of Origin Plus 1.1 Origins 1.10.0 OwO Lib 0.11.2 PacketFixer 1.2.8 Pehkui 3.8.0 Phantom Redux https://github.com/DerpDerpling/PhantomRedux/releases/tag/1.20-jar Pigs Have Litters 1.0.1 Polymer bundled-0.5.20 RecipeCooldown 1.0.0 SeedGuard 1.0.0 Separated Leaves 2.4.0 ServerCore 1.5.1 ShowMeWhatYouGot 1.1.1 SIHYWTCAMC 1.4.5 SIHYWTCAMD 1.10.1 Smarter Farmers 1.8.1 SmoothChunk 3.6 Snow Real Magic 10.4.3 Spark 1.10.53 Starlight 1.1.2 Statement 4.2.9 Structory 1.3.4 Structory Towers 1.0.6 Styled Chat 2.2.3 AxoAmigos 0.0.2 Terrestria 6.0.13 TooManyOrigins 1.1.1 Transferable Pets 1.0.4 Traverse 7.0.11 Universal Shops 1.3.2 BCLib (yeah...) 3.0.14 Vanish 1.5.4 VC Interaction 1.0.6 Simple Voice Chat 2.5.12 Water Resistance Potion 1.3.2 WaterWalkingFix 1.0.0 What Are They Up To 1.1.1 WilderWild 2.3.3 Chimes 1.2.4 What Is This Structure 1.1.0 WorldEdit 7.2.15 XL Packets 1.0.4 You Shall Not Spawn! 1.0.5 Yung's API 4.0.2 Yung's Better Mineshafts 4.0.4

Sorry this took so long. I wrote this over the span of a couple days painstakingly scrolling down my server panel's mod folder one by one.

Fourmisain commented 3 months ago

Sorry this took so long. I wrote this over the span of a couple days painstakingly scrolling down my server panel's mod folder one by one.

Oof. Might have been enough to get a list of mod ids out of the latest.log. If it's any consolation, it might take me equally long to go through all the mods. I took a quick glance at the list and didn't see any obvious mod that could conflict. ModernFix and Carpet Fixes I already tested. There's a bunch of "mod library" type mods that could literally do anything, like Collective, which...

...

which is the cause!

With it, the test immediately fails. Neither display name nor lore are retained. First time I tested I had some other mods and it did turn the name italics as well. Using only Collective and Keep Head Names, it's not italics, so there might still be more going on, not sure.

Gonna open report the issue on Serilum's issue tracker.

Fourmisain commented 3 months ago

Wait... I swear I had it disabled just now, only Keep Head Names, and it didn't work?

...

~~Yeah, I can consistently reproduce the issue now! ...? Just what is going on.~~

~~Okay, at least I can now start debugging. I think I actually have one idea what could be going on.~~

Edit: I have no idea how, but apparently Fabric Loader got disabled in Prism Launcher, so no wonder nothing was working...

And now I can confirm that is indeed is Collective, so back to reporting it is.