BenCodez / VotingPlugin

Plugin on SpigotMC
Other
83 stars 68 forks source link

Issue with adding reward file to Config.yml #571

Closed Jaksattack closed 5 years ago

Jaksattack commented 5 years ago

the /av Testreward will give the reward to the player

however, it will not load votesites.yml if you add the - 'reward' to the reward section

Any help would be great

BenCodez commented 5 years ago

You must have a yml error when you add it.

On Tue., Jul. 9, 2019, 11:49 p.m. Jaksattack, notifications@github.com wrote:

the /av Testreward will give the reward to the player

however, it will not load votesites.yml if you add the - 'reward' to the reward section

Any help would be great

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Ben12345rocks/VotingPlugin/issues/571?email_source=notifications&email_token=AECIQN5OYX3NKY74OMSJ3PLP6VL5ZA5CNFSM4H7LFFD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G6H367Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AECIQN7WHRTD3JGIZ7FZQALP6VL5ZANCNFSM4H7LFFDQ .

Jaksattack commented 5 years ago

here is the error...

Craft Scheduler Thread - 14/ERROR Cannot load plugins/VotingPlugin/VoteSites.yml 10.07 11:41:15 [Server] INFO org.bukkit.configuration.InvalidConfigurationException: while parsing a block mapping 10.07 11:41:15 [Server] INFO in 'string', line 7, column 5: 10.07 11:41:15 [Server] INFO Enabled: true 10.07 11:41:15 [Server] INFO ^ 10.07 11:41:15 [Server] INFO expected , but found '' 10.07 11:41:15 [Server] INFO in 'string', line 15, column 7: 10.07 11:41:15 [Server] INFO Command: 10.07 11:41:15 [Server] INFO ^ 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:56) ~[spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:183) [spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.AdvancedCore.YML.YMLFile.reloadData(YMLFile.java:78) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.Main.reload(Main.java:966) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.Commands.CommandLoader$14.execute(CommandLoader.java:464) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.AdvancedCore.CommandAPI.CommandHandler$1.run(CommandHandler.java:382) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftTask.run(CraftTask.java:81) [spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212] 10.07 11:41:15 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212] 10.07 11:41:15 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212] 10.07 11:41:15 [Server] INFO Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping 10.07 11:41:15 [Server] INFO in 'string', line 7, column 5: 10.07 11:41:15 [Server] INFO Enabled: true 10.07 11:41:15 [Server] INFO ^ 10.07 11:41:15 [Server] INFO expected , but found '' 10.07 11:41:15 [Server] INFO in 'string', line 15, column 7:

here is the votesite.yml

Reward for any site

Similar to AnySiteReward

This requires the site to be configured in order to get the reward.

VoteSites: MCSL: Enabled: true ServiceSite: MCSL VoteURL: https://minecraft-server-list.com/server/441575/vote/ VoteDelay: 24 Item: Material: minecraft:cooked_beef Amount: 1 Rewards: 'reward' Command: Console:

here is the reward.yml

This is a reward file

Define rewards in here (Items, commands, etc)

File name is the reward name, without file extention

This reward is named "ExampleBasic"

That is what you put as a reward for other plugins, like VotingPlugin

DO NOT HAVE DUPLICATE NAMES!!

Wiki Page:

https://github.com/Ben12345rocks/AdvancedCore/wiki/Reward-files

This is basic reward file

You can have multiple reward files that contain all kinds of rewards

Below are some basic things you can have, see the advanced example for more

You can just remove values you don't want (just delete it)

If you just want money just have a reward file containg only "Money: 100", for example

You can simply copy and paste from here what you want

in other reward files, that is the way they are designed

Items to give to user

Items:

Item

This is not item display name

No duplicate names

Emerald:

Item Material

# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Material: 'EMERALD'
# Item data value (Eg 1:4, data is 4)
Data: 0
# Will only give Amount if min and max amounts are 0
Amount: 1
# Set item durability
# Set to 0 or remove line for no durability
#Durability: 100

# Random amount of items between Min and Max will be given
# if min and max are not both 0

# Min amount of items
#MinAmount: 1

# Max amount of items
#MaxAmount: 4

# Item name
# Remove this value to have no name
Name: '&aReward Emmie'

Amount of money to give, requires vault

Use 0 to give none

Money is not per world

Use negative to take money

Money: 1000

Give player experience

EXP: 100

Commands:

Commands here will be run by console

Console:

- 'say %player% was lucky'

Commands here are run by player

Player:

- 'vote total'

Messages: Player: '&aYou have received a reward'

BenCodez commented 5 years ago

Pastebin your votesites.yml

On Wed., Jul. 10, 2019, 11:43 a.m. Jaksattack, notifications@github.com wrote:

here is the error...

Craft Scheduler Thread - 14/ERROR Cannot load plugins/VotingPlugin/VoteSites.yml 10.07 11:41:15 [Server] INFO org.bukkit.configuration.InvalidConfigurationException: while parsing a block mapping 10.07 11:41:15 [Server] INFO in 'string', line 7, column 5: 10.07 11:41:15 [Server] INFO Enabled: true 10.07 11:41:15 [Server] INFO ^ 10.07 11:41:15 [Server] INFO expected , but found '' 10.07 11:41:15 [Server] INFO in 'string', line 15, column 7: 10.07 11:41:15 [Server] INFO Command: 10.07 11:41:15 [Server] INFO ^ 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:56) ~[spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:183) [spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.AdvancedCore.YML.YMLFile.reloadData(YMLFile.java:78) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.Main.reload(Main.java:966) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.Commands.CommandLoader$14.execute(CommandLoader.java:464) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at com.Ben12345rocks.VotingPlugin.AdvancedCore.CommandAPI.CommandHandler$1.run(CommandHandler.java:382) [VotingPlugin.jar:?] 10.07 11:41:15 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftTask.run(CraftTask.java:81) [spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [spigot_1.14.3.jar:git-Spigot-595711b-e8b39d4] 10.07 11:41:15 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212] 10.07 11:41:15 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212] 10.07 11:41:15 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212] 10.07 11:41:15 [Server] INFO Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping 10.07 11:41:15 [Server] INFO in 'string', line 7, column 5: 10.07 11:41:15 [Server] INFO Enabled: true 10.07 11:41:15 [Server] INFO ^ 10.07 11:41:15 [Server] INFO expected , but found '' 10.07 11:41:15 [Server] INFO in 'string', line 15, column 7:

here is the votesite.yml Reward for any site Similar to AnySiteReward This requires the site to be configured in order to get the reward.

VoteSites: MCSL: Enabled: true ServiceSite: MCSL VoteURL: https://minecraft-server-list.com/server/441575/vote/ VoteDelay: 24 Item: Material: minecraft:cooked_beef Amount: 1 Rewards: 'reward' Command: Console:

  • '/give %player% minecraft:emerald 1' Messages: Player: '&aThanks for voting on %ServiceSite%!'

here is the reward.yml This is a reward file Define rewards in here (Items, commands, etc) File name is the reward name, without file extention This reward is named "ExampleBasic" That is what you put as a reward for other plugins, like VotingPlugin DO NOT HAVE DUPLICATE NAMES!! Wiki Page: https://github.com/Ben12345rocks/AdvancedCore/wiki/Reward-files This is basic reward file You can have multiple reward files that contain all kinds of rewards Below are some basic things you can have, see the advanced example for more You can just remove values you don't want (just delete it) If you just want money just have a reward file containg only "Money: 100", for example You can simply copy and paste from here what you want in other reward files, that is the way they are designed Items to give to user

Items: Item This is not item display name No duplicate names

Emerald:

Item Material

https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html

Material: 'EMERALD'

Item data value (Eg 1:4, data is 4)

Data: 0

Will only give Amount if min and max amounts are 0

Amount: 1

Set item durability

Set to 0 or remove line for no durability

Durability: 100

Random amount of items between Min and Max will be given

if min and max are not both 0

Min amount of items

MinAmount: 1

Max amount of items

MaxAmount: 4

Item name

Remove this value to have no name

Name: '&aReward Emmie'

Amount of money to give, requires vault Use 0 to give none Money is not per world Use negative to take money

Money: 1000

Give player experience

EXP: 100

Commands:

Commands here will be run by console Console: - 'say %player% was lucky' Commands here are run by player Player: - 'vote total'

Messages: Player: '&aYou have received a reward'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ben12345rocks/VotingPlugin/issues/571?email_source=notifications&email_token=AECIQN7WFKWOJV5W7FQQVWLP6X7TXA5CNFSM4H7LFFD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZT4H4Y#issuecomment-510116851, or mute the thread https://github.com/notifications/unsubscribe-auth/AECIQN4SDQOYWD5VGZL7Z3LP6X7TXANCNFSM4H7LFFDQ .

Jaksattack commented 5 years ago

https://pastebin.com/byGj2Urz

BenCodez commented 5 years ago

Where is the reward file? Make sure to remove the message section when you add it.

On Wed., Jul. 10, 2019, 10:42 p.m. Jaksattack, notifications@github.com wrote:

https://pastebin.com/byGj2Urz

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ben12345rocks/VotingPlugin/issues/571?email_source=notifications&email_token=AECIQN5UEVZWDUJNE3ZCQPDP62M2JA5CNFSM4H7LFFD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZVKORY#issuecomment-510306119, or mute the thread https://github.com/notifications/unsubscribe-auth/AECIQNZR3K6WKICNNZ5YGHLP62M2JANCNFSM4H7LFFDQ .

Jaksattack commented 5 years ago

name of the file is reward.yml

Items: Emerald:

Item Material

# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Material: 'EMERALD'
# Item data value (Eg 1:4, data is 4)
Data: 0
# Will only give Amount if min and max amounts are 0
Amount: 1
# Set item durability
# Set to 0 or remove line for no durability
#Durability: 100

# Random amount of items between Min and Max will be given
# if min and max are not both 0

# Min amount of items
#MinAmount: 1

# Max amount of items
#MaxAmount: 4

# Item name
# Remove this value to have no name
Name: '&aReward Emmie'

Money: 1000

EXP: 100

Commands:

Messages: Player: '&aYou have received a reward'

Thanks for all your help...

BenCodez commented 5 years ago

Set your Rewards to this:

Rewards:
- reward

Make sure to remove the message section.