WooMinecraft / woominecraft-wp

A FREE Minecraft Donation Plugin for WordPress designed to work in conjunction with WooMinecraft for Bukkit/Spigot & WooCommerce to allow the purchasing of virtual items in MineCraft and have them delivered to the servers.
https://wordpress.org/plugins/woominecraft/
GNU General Public License v2.0
32 stars 14 forks source link

Error when running command after purchase #92

Closed TrickShotMLG02 closed 2 years ago

TrickShotMLG02 commented 2 years ago

I have the following command:

give %s blue_shulker_box{display:{Name:"§9§lCHRISTMAS §6§l2021 §2§lGIFT",Lore:["§bOnly obtainable in the server shop with a specific voucher!"]},BlockEntityTag:{Items:[{Slot:0,id:diamond,Count:16},{Slot:1,id:ender_pearl,Count:16},{Slot:2,id:diamond_sword,Count:1,tag:{Enchantments:[{id:sharpness,lvl:3},{id:looting,lvl:2},{id:unbreaking,lvl:1}]}},{Slot:3,id:diamond_pickaxe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:3},{id:fortune,lvl:1}]}},{Slot:4,id:diamond_axe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:2}]}},{Slot:5,id:diamond_shovel,Count:1,tag:{Enchantments:[{id:efficiency,lvl:5},{id:unbreaking,lvl:3}]}},{Slot:6,id:spruce_log,Count:64},{Slot:7,id:spruce_log,Count:64},{Slot:8,id:firework_rocket,Count:64},{Slot:9,id:phantom_membrane,Count:16}]}} 1

Te console gives me the following error: Error: Unknown Item: blue_shulker_box{display:{name:"christmas.

Can somebody help me?

JayWood commented 2 years ago

You have to prefix the item names I believe, try minecraft:blue_shulker_box

TrickShotMLG02 commented 2 years ago

i dont think so. this command works perfectly fine: give %s cooked_beef 64

JayWood commented 2 years ago

OK but what about give blue_shulker_box? The commands are ran as the console user, so if the console user has access to the block, it should give the block out no issues. That being said, I've never tested it with full JSON data before. I would verify it works with the give command blue_shulker_box locally, and if it does, then maybe remove the JSON data from the command and test again. If that works then, it narrows down the issue to the JSON data, and what causes that I'm unsure but can at least test that.

jerzean commented 2 years ago

if the mc server has EssentialsX/Essentials, that plugin replaces /give with its own version of the command, try /minecraft:give %s blue_shulker_box{display:{Name:"§9§lCHRISTMAS §6§l2021 §2§lGIFT",Lore:["§bOnly obtainable in the server shop with a specific voucher!"]},BlockEntityTag:{Items:[{Slot:0,id:diamond,Count:16},{Slot:1,id:ender_pearl,Count:16},{Slot:2,id:diamond_sword,Count:1,tag:{Enchantments:[{id:sharpness,lvl:3},{id:looting,lvl:2},{id:unbreaking,lvl:1}]}},{Slot:3,id:diamond_pickaxe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:3},{id:fortune,lvl:1}]}},{Slot:4,id:diamond_axe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:2}]}},{Slot:5,id:diamond_shovel,Count:1,tag:{Enchantments:[{id:efficiency,lvl:5},{id:unbreaking,lvl:3}]}},{Slot:6,id:spruce_log,Count:64},{Slot:7,id:spruce_log,Count:64},{Slot:8,id:firework_rocket,Count:64},{Slot:9,id:phantom_membrane,Count:16}]}} 1

TrickShotMLG02 commented 2 years ago

new command: minecraft:give %s blue_shulker_box{display:{Name:"§9§lCHRISTMAS §6§l2021 §2§lGIFT",Lore:["§bOnly obtainable in the server shop with a specific voucher!"]},BlockEntityTag:{Items:[{Slot:0,id:diamond,Count:16},{Slot:1,id:ender_pearl,Count:16},{Slot:2,id:diamond_sword,Count:1,tag:{Enchantments:[{id:sharpness,lvl:3},{id:looting,lvl:2},{id:unbreaking,lvl:1}]}},{Slot:3,id:diamond_pickaxe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:3},{id:fortune,lvl:1}]}},{Slot:4,id:diamond_axe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:2}]}},{Slot:5,id:diamond_shovel,Count:1,tag:{Enchantments:[{id:efficiency,lvl:5},{id:unbreaking,lvl:3}]}},{Slot:6,id:spruce_log,Count:64},{Slot:7,id:spruce_log,Count:64},{Slot:8,id:firework_rocket,Count:64},{Slot:9,id:phantom_membrane,Count:16}]}} 1

i now have have the following error:

[19:38:23] [Server thread/INFO]: Expected value
[19:38:23] [Server thread/INFO]: ...lay:{Name:&quot;§9§lCHRISTMAS §6§l2021 §2§lGIFT&quot;,Lore:[&quot;§bOnly obtainable in the server shop with a specific voucher!&quot;]},BlockEntityTag:{Items:[{Slot:0,id:diamond,Count:16},{Slot:1,id:ender_pearl,Count:16},{Slot:2,id:diamond_sword,Count:1,tag:{Enchantments:[{id:sharpness,lvl:3},{id:looting,lvl:2},{id:unbreaking,lvl:1}]}},{Slot:3,id:diamond_pickaxe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:3},{id:fortune,lvl:1}]}},{Slot:4,id:diamond_axe,Count:1,tag:{Enchantments:[{id:efficiency,lvl:3},{id:unbreaking,lvl:2}]}},{Slot:5,id:diamond_shovel,Count:1,tag:{Enchantments:[{id:efficiency,lvl:5},{id:unbreaking,lvl:3}]}},{Slot:6,id:spruce_log,Count:64},{Slot:7,id:spruce_log,Count:64},{Slot:8,id:firework_rocket,Count:64},{Slot:9,id:phantom_membrane,Count:16}]}} 1<--[HERE]
mmuziek commented 2 years ago

Have u tried designing it with a online command generator and using that from a command block

JayWood commented 2 years ago

@mmuziek don't think that'd matter, I see the issue here - it's related to the " being transformed into HTML entities like &quot;

@TrickShotMLG02 you could try escaping the values on save by changing instances of " in your command to \" but not sure if that'd help. There is another ticket elsewhere asking the same thing. I need to get this resolved on the web side.

TrickShotMLG02 commented 2 years ago

Have u tried designing it with a online command generator and using that from a command block

Yes, it works perfectly fine with a commandblock

TrickShotMLG02 commented 2 years ago

@mmuziek don't think that'd matter, I see the issue here - it's related to the " being transformed into HTML entities like &quot;

@TrickShotMLG02 you could try escaping the values on save by changing instances of " in your command to \" but not sure if that'd help. There is another ticket elsewhere asking the same thing. I need to get this resolved on the web side.

I will try it asap

*Edit: Didn't work

jerzean commented 2 years ago

@mmuziek don't think that'd matter, I see the issue here - it's related to the " being transformed into HTML entities like &quot; @TrickShotMLG02 you could try escaping the values on save by changing instances of " in your command to \" but not sure if that'd help. There is another ticket elsewhere asking the same thing. I need to get this resolved on the web side.

I will try it asap

*Edit: Didn't work

another way of doing this would be to save said item in a kit via essentials, and just giving said kit instead of the whole command/data string /kit ShopItem %s granted this only works if you have essentials installed or a kit plugin

TrickShotMLG02 commented 2 years ago

This is a great idea!!

I will try that today