BentoBoxWorld / AOneBlock

A OneBlock Minecraft Game for BentoBox
https://docs.bentobox.world
Eclipse Public License 2.0
77 stars 29 forks source link

bug in block-data using vault #396

Open Vinrey123 opened 2 months ago

Vinrey123 commented 2 months ago

Expected behavior

I would like to use the ominous storage on oneblock

Observed/Actual behavior

I wanted to create an ominous storage using a data block, but for some reason it doesn't work, although if I use the same command in minecraft, then it works. updated: by the way, as I noticed, blockdata does not work at all with the new 1.21 tags

Steps/models to reproduce

https://github.com/user-attachments/assets/38be1388-636f-4599-bdc9-5887082dac94 https://github.com/user-attachments/assets/c841677c-cdb0-40b7-a4a1-f0c75ee7fb72

BentoBox version

BentoBox 2.4.2 Paper 1.21 AOneBlock 1.17.0

Plugin list

No response

Other

No response

tastybento commented 2 months ago

I haven't been able to try your strings (would be good if you pasted them rather than used a screenshot), but are you sure they are correct? Do they work in the command line with /setblock? The code just passes the string to the server with no change, so we're not really doing much with it.

I used https://mcstacker.net/ to make something similar and it looks different to your command:

minecraft:vault[ominous=true]{config:{loot_table:"minecraft:chests/trial_chambers/reward_ominous",key_item:{id:"minecraft:ominous_trial_key"}},shared_data:{loot_table:"minecraft:chests/trial_chambers/reward_ominous"}}

Vinrey123 commented 2 months ago

here is the command I use: minecraft:vault[ominous=true]{config:{key_item:{id:"minecraft:ominous_trial_key"},loot_table:"minecraft:chests/trial_chambers/reward_ominous"}}

I am completely sure that this command works in regular minecraft using the /setblock command. I've also tried using /give, but that doesn't work either. I also tried your command, but nothing works.

I also tried to create a suspicious sand with a date, but that doesn't work either. The only thing that works is an example command in phases.

minecraft:suspicious_sand[dusted=3] minecraft:vault[ominous=true]

that is, as I understand it, the plugin does not see what is in curly brackets, but only in square ones.

tastybento commented 2 months ago

Hmm, well, it looks like the API call to set the block state with the curly brackets is not supported. There's discussion here: https://www.spigotmc.org/threads/bukkit-createblockdata-with-curly-braces.611823/

The PR the guy mentions at the end almost made it but was rejected, but I don't think it was going to handle the curly braces anyway and was more for the sherds.

So, I'm afraid this won't work.

So, let's see if we can trick it to do it by running the setblock command instead. Please try out the 1.17.1-SNAPSHOT and let me know if that works.

Vinrey123 commented 2 months ago

After checking version 1.17.1-SNAPSHOT, everything worked fine. Thanks for the help, I really wanted it.

But could you add the shutdown /setblock function to the console? It's just that when a lot of people dig one block, the console will spam /setblock

That's what it says: [06:19:54 INFO]: Changed the block at 0, 80, 600 [06:19:59 INFO]: Changed the block at 0, 80, 600 [06:21:38 INFO]: Changed the block at 0, 80, 600 https://github.com/user-attachments/assets/e83ce8de-4e15-4736-94c3-18c0871e9e87