[SPIGOT-3987] Writing in book removes LocName attribute Created: 06/Jul/18  Updated: 08/Jul/18  Resolved: 08/Jul/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Panossa Assignee: md_5
Resolution: Fixed Votes: 2
Labels: Spigot,, advancement, advancements, function, functions, mapmaking
Environment:

(Virtual) game server with "openjdk:8-jre" (Java 8), hardware:
Intel Xeon E3-1230 v2 or E3-1231 v3 (unknown),
32GB ECC DDR3 RAM,
Linux OS (no idea which exactly).

This bug is present on every other system we tested though:
1. Win7 Home Premium 64bit with Java 8 64bit. (latest Spigot)
2. Linux (Ubuntu) root server with latest Spigot and Java 8.


Attachments: Zip Archive Advancement-Popup-Sleeping-System-for-Servers.zip     Text File latest.log     Zip Archive sorcerersbook2.zip    
Version: Latest 1.12 build (spigot-R0.1-642f6d2-6103339)

 Description   

We tried playing a map ( http://www.minecraftmaps.com/game-maps/sorcerers-book-2 ) in vanilla Minecraft, it worked flawlessly.
Now we're testing whether it works on Spigot. Sadly, on none of our testing servers the main mechanic of unlocking spells really works.

Here are our current configs (we tested a few, see "Description" for more):
Commands.yml:

command-block-overrides:
- '*'
unrestricted-advancements: true
aliases:
 icanhasbukkit:
 - version $1-

Spigot.yml:
    Default except: 

commands:
 tab-complete: 0
 log: true
 spam-exclusions:
 - /skill
 silent-commandblock-console: false
 replace-commands:
 - help

    (And we changed mobranges.)

Bukkit.yml:

<default>

What is supposed to happen:
1. You open the book you have in your first hotbar slot form the beginning.
2. You type the short tag aka symbol of a spell (e.g. "BAL") into the book.
3. You click on "Cast spell" (if you have the texture pack enabled. If not, click the right button.)
4. You get a message in chat that your spell is unlocked and you get a new hotbar item to cast it.

What happens instead (even with all the configs mentioned above):
1. You open the book in the first hotbar slot.
2. You type e.g. "BAL" into the book. (we tested many spells).
3. You click on "Cast spell".
4. Nothing.

Even if you are OP nothing happens. What I first suspected when testing this is that advancements test for permissions and as Spigot has its own system it could have gone wrong there. Sadly, even with the right configs and even if all players are OP none of the commands in the advancement reward function get triggered. 

We tested:

  • Players aren't OP with default Spigot config.
  • Players are OP with default Spigot config.
  • Players aren't OP with changed Spigot config (as seen above).
  • Players are OP with changed Spigot config (as seen above).

My conclusion:
Somehow commands in the advancement reward function, more specifically the function itself, doesn't get triggered at all.

The log doesn't say anything (all commands being executed and shown in the chat/log by us were executed through manual input in chat), I'll attach it anyways. Also attached our own copy of the map in a zip file, though you can download a fresh copy on your own, both won't work.

Edit 1: I've recieved a small function/advancement zip with only one example of advancement rewards and it works. So Sorcerers Book 2 isn't working on Spigot, though the newly attached file is working.
Edit 2: We tested again, the Sorcerers Book 2 works on Vanilla Minecraft 1.12.2. It's really just breaking in the Spigot context. Meaning maybe advancements aren't even what is broken here, but something is!



 Comments   
Comment by md_5 [ 08/Jul/18 ]

Issue was nothing to do with advancements, rather LocName was not being preserved when writing in a book

Comment by Panossa [ 07/Jul/18 ]

Btw Phoenix, if you'd like, you can add me on Discord: @Panossa(YT)#8203

Comment by Panossa [ 07/Jul/18 ]

Well, I could add here that we tested adding a tellraw in the reward function for unlocking spells. If you then grant yourself the advancement, the tellraw isn't called at all. Can you test that, Phoenix? Seems like two different pieces are buggy then, right? The text detection inside the book if you close/update it and the reward functions, if our test with the tellraw was correct. Going to break down the functions today by deleting everything but what is needed for bal to work.

Comment by Phoenix616 [ 07/Jul/18 ]

I did some testing and it seems that the advancement that is used to detect the writing in the book (sorcerersbook:spell/bal) isn't triggered at all. Granting it with the ingame command works and runs the commands but trying to trigger it automatically doesn't do anything. (I tried multiple different triggers besides the inventory_changed one with the book as I suspected that the book page text detection gets broken by CraftBukkit's book meta/text handling)

Comment by md_5 [ 07/Jul/18 ]

Yes, but it needs to be like 5 functions / commands. To this ticket is fine.

Comment by Panossa [ 07/Jul/18 ]

Hey, md_5!
I know you hate all this mapmaking stuff and the problems coming along with those very much, as you showed e.g. here. Makes me smirk every time, although I'm a (noob) programmer myself so I can relate to that and I really don't want to be you in terms of bugfixing, especially this stuff.

But let's talk about the problem. I know the map has way to many function files etc, although I'm really not able to debug Java code at this level. Would it be okay if I come back at you with a lite version of the broken map where only as few commands are in there as possible? Or do I really need to find a specific cause for what's breaking? Cause I'm not sure I can do that without debugging the code of Spigot itself.

Edit: If it's okay to reup the broken part of the map, do I need to open another issue or should I attach it here?

Comment by md_5 [ 06/Jul/18 ]

Yeah I just downloaded that adventure map, there is no way I can spend time debugging an entire adventure map.
You need to specifically identify and attach the broken component.
My official stance remains that if you need to run an adventure map that is built in hundreds/thousands of command blocks/functions then that is what Vanilla is for.

Of course if you can identify a specific issue I will endeavour to fix it, but there are 5487 functions in that map!!

Comment by md_5 [ 06/Jul/18 ]

You have no idea how much I hate things like this

Generated at Fri Mar 14 09:35:37 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.