MobHunting

MobHunting

114k Downloads

Impossible achievements

vilgrar opened this issue ยท 20 comments

commented

There are two achievements that I believe are impossible to activate.

Villager - is a category name, not a mob name. Regardless of what type of villager I kill, this will never start counting.

Cartographer - Cartographer is a career name, but the achievements are profession based (source: [http://minecraft.gamepedia.com/Villager#Professions_and_careers]). When I kill a cartographer, I'm getting rewarded for killing a librarian.

Example:
[http://picpaste.com/2017-06-04_11.21.29-lG5ndnm4.png]
There's a cartographer in front of me.

[http://picpaste.com/2017-06-04_11.21.41-QF9MgBAw.png]
Text says I killed a librarian.

[http://picpaste.com/2017-06-04_11.22.35-yeIHwi5r.png]
Leaderboard updates librarian (the profession achievement), not cartographer (career achievement does not exist).

commented

I agree that I have a problem with the Villagers, but it is unfortunately as easy as you think.

My plugin needs to be backwards compatible down to MC 1.7.9 R2 / MC 1.7.10 and the Villager has changed a lot over time...

  • MC 1.7.10 - There was only on Villager. This is the Villager in the config.yml. I can replace the Villager if you know which Profession replaced the Villager from MC 1.7.10?
  • MC 1.10 - There came 5 Villagers and the Professions was introduced
  • MC 1.11 - A new Villager (Netwit) was added.

I don't know when the Career was introduceted but unless you think it is important I think I will drop the Cartographer and and only categorize on the 6 Villagers/Professions?

What do you think?

commented

Oh, I didn't realize the complexity of backwards compatibility.

I don't know much about 1.7.10, but dropping cartographer and focusing on the six professions sounds like a good idea. Even if you could make achievements based on career, they'd be bothersome to hunt and kind of boring (same skulls). Besides, there's enough achievements already.

commented

This is all the stuff I have made in V4.9.4

V4.9.4

  • Fixed Ticket 235 - NPE when achieving Level 7 achievements (#235)
  • Fixed Ticket 236 - where players got a reward while fishing on the ground. (#236)
  • Tried to fix Ticket 207 - Server timeout on a PaperSpigot server (#207)
  • Fixed Ticket 237: Changed the way the Total number of achievements is counted. (#237)
  • Added an extra EighthHuntAchivement.
  • Added Hunt Progress Achievements for MythicMobs, MysteriousHalloween, Citizens, TARDISWeepingAngels, CustomMobs, SmartGiants
  • Added Support for SmartGiants (https://www.spigotmc.org/resources/smartgiants.4882/)
  • Removed Cartographer from config.yml

Please help me Test build 389 (notice the new achivements for Mythicmobs)
https://fractal.lindegaard.one:8181/job/MobHunting/

commented

He he, One thing I have learned. The player are very good at finding shortcuts to make money, and do things I have never imagined. So I am pretty sure that we will see more bugs in the future.

Achivements will not be shown if Prize =0 and mobRunCmd="" unless show-achievements-without-a-reward is true in config.yml. Please test build 392
https://fractal.lindegaard.one:8181/job/MobHunting/

I will release 3.9.4 if you say okay.

I cant make bullet 2+3 for the moment being. Adding plural to the strings, will add a complexity, hich Im not sure I want to make. And the protocollib error "is not possible" so unless another user can replicate your bug, I have no idea on what to do.

commented

Using B393 but it doesn't seem to work, or maybe I misunderstand something.

These are my settings for my test mob:
skeletonhorse: '0'
skeletonhorse-cmd: "mobhunt head give {player} skeletonhorse SkeletonHorse 1 silent"
skeletonhorse-cmd-desc: You got a SkeletonHorse skull
skeletonhorse-cmd-run-chance: 0.05
skeletonhorse-head-prize: '0'

Kill when using show-achievements-without-reward: false

[15:07:59 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[15:07:59 INFO]: [MobHunting][Debug] vilgrar killed a SkeletonHorse (Minecraft)
[15:07:59 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a SkeletonHorse
[15:07:59 INFO]: [MobHunting][Debug] vilgrar has no Rank Multiplier
[15:07:59 INFO]: [MobHunting][Debug] Multiplier: Difficulty = 0.75
[15:07:59 INFO]: [MobHunting][Debug] Multiplier: Sneaky! = 2.0
[15:07:59 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[15:07:59 INFO]: [MobHunting][Debug] KillBlocked vilgrar: Reward was less than 0.01 (Bonuses=x1.5 * Difficulty * Sneaky!)
[15:07:59 INFO]: [MobHunting][Debug] Command will be run if chance: 0.05 > 0.7069379335772455 (random number)
[15:07:59 INFO]: [MobHunting][Debug] ======================= kill ended (36)=====================

Kill when using show-achievements-without-reward: true

[15:08:47 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[15:08:47 INFO]: [MobHunting][Debug] vilgrar killed a SkeletonHorse (Minecraft)
[15:08:47 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a SkeletonHorse
[15:08:47 INFO]: [MobHunting][Debug] vilgrar has no Rank Multiplier
[15:08:47 INFO]: [MobHunting][Debug] Multiplier: Difficulty = 0.75
[15:08:47 INFO]: [MobHunting][Debug] Multiplier: Sneaky! = 2.0
[15:08:47 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[15:08:47 INFO]: [MobHunting][Debug] KillBlocked vilgrar: Reward was less than 0.01 (Bonuses=x1.5 * Difficulty * Sneaky!)
[15:08:47 INFO]: [MobHunting][Debug] Command will be run if chance: 0.05 > 0.9245920790879898 (random number)
[15:08:47 INFO]: [MobHunting][Debug] ======================= kill ended (36)=====================

Both cases seem to be identical. No reward (works as intended)), head drop chance (works as intended) but neither setting activates the SkeletonHorse achievement.

commented

Well you have a Reward.... by definition...

skeletonhorse-cmd: "mobhunt head give {player} skeletonhorse SkeletonHorse 1 silent

The reward is a command to be run potentially. In this case a head. So in both cases it doesn't look at "show-achievements-without-reward"

The run commands counts as rewards...

commented

So head drop chance has nothing to do with show-achievements-without-reward, like I thought.

But show-achievements-without-reward: true was supposed to make the achievement activate when I killed the skeleton horse, right? Because the kill didn't count.

commented

Phew, and I thought there was next to nothing left to do.

Remaining issues that I can think of:

  • Enable or disable achievements for 0 prize mobs
  • Fix plural in achievement descriptions (like 'Hunt 100 Raw Fish'). I mentioned this in 'Language fixes'
  • Fix possible ProtocolLib Java error (hard to replicate)

I have to find out how to post a review as well. I looked everywhere but can't find a #%"% button or post field.

commented

Im sorry, I got the AND / OR / NOT logics all mixed up. In some of my if-statements the logic is very complex. :-(

Please try build 394

if show-achievements-without-reward=true the reward will be shown in the gui , no matter if the prize = 0 and runcmd =""

commented

Nope =( No achievement yet. Debug info is identical to before.

[22:45:08 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[22:45:08 INFO]: [MobHunting][Debug] vilgrar killed a SkeletonHorse (Minecraft)
[22:45:08 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a SkeletonHorse
[22:45:08 INFO]: [MobHunting][Debug] Multiplier: Sneaky! = 2.0
[22:45:08 INFO]: [MobHunting][Debug] Multiplier: Difficulty = 0.75
[22:45:08 INFO]: [MobHunting][Debug] vilgrar has no Rank Multiplier
[22:45:08 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[22:45:08 INFO]: [MobHunting][Debug] KillBlocked vilgrar: Reward was less than 0.01 (Bonuses=x1.5 * Sneaky! * Difficulty)
[22:45:08 INFO]: [MobHunting][Debug] Command will be run if chance: 0.05 > 0.35424732460967123 (random number)
[22:45:08 INFO]: [MobHunting][Debug] ======================= kill ended (36)=====================

commented

Now it works (i hope) i have tested all 4 combinations. Please test build 395
https://fractal.lindegaard.one:8181/job/MobHunting/

[23:44:58 INFO]: Rocologo issued server command: /spawnmob donkey
[23:45:09 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[23:45:09 INFO]: [MobHunting][Debug] Rocologo killed a Donkey (Minecraft)
[23:45:09 INFO]: [MobHunting][Debug] Permission 'mobhunting.mobs.' or 'mobhunting.mobs.DONKEY' not set, defaulting to True.
[23:45:09 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a Donkey
[23:45:09 INFO]: [MobHunting][Debug] Multiplier: Sniper = 2.5
[23:45:09 INFO]: [MobHunting][Debug] Multiplier: Rank = 1.05
[23:45:09 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[23:45:09 INFO]: [MobHunting][Debug] RecordAchievement: hunting-level1-donkey achieved.
[23:45:09 INFO]: CONSOLE issued server command: /give Rocologo gold_ingot 5
[23:45:09 INFO]: Giving 5 of gold ingot to Rocologo.
[23:45:10 INFO]: [MobHunting][Debug] RecordKill: Rocologo killed a Donkey (Minecraft) Cash=$0
[23:45:10 INFO]: [MobHunting][Debug] Reward was less than Rocologo (Bonuses=0.2)
[23:45:10 INFO]: [MobHunting][Debug] Command will be run if chance: 0.5 > 0.13213211679359205 (random number)
[23:45:10 INFO]: [MobHunting][Debug] Command to be run:mobhunt head give Rocologo donkey Donkey 1 silent
[23:45:10 INFO]: [MobHunting][Debug] Description to be send:You got a Donkey Skull
[23:45:10 INFO]: [MobHunting][Debug] ======================= kill ended (37)=====================
[23:45:10 INFO]: [MobHunting][Debug] Rocologo picked up $0 money. (# of rewards left=0)
[23:45:44 INFO]: Rocologo issued server command: /spawnmob cow
[23:45:48 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[23:45:48 INFO]: [MobHunting][Debug] Rocologo killed a Cow (Minecraft)
[23:45:48 INFO]: [MobHunting][Debug] Permission 'mobhunting.mobs.
' or 'mobhunting.mobs.COW' not set, defaulting to True.
[23:45:48 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a Cow
[23:45:48 INFO]: [MobHunting][Debug] KillBlocked Cow(486): There is no reward and no penalty for this Mob/Player and is not counted as kill/achievement.
[23:45:48 INFO]: [MobHunting][Debug] ======================= kill ended (29)=====================
[23:46:05 INFO]: Rocologo issued server command: /spawnmob chicken
[23:46:10 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[23:46:10 INFO]: [MobHunting][Debug] Rocologo killed a Chicken (Minecraft)
[23:46:10 INFO]: [MobHunting][Debug] Permission 'mobhunting.mobs.' or 'mobhunting.mobs.CHICKEN' not set, defaulting to True.
[23:46:10 INFO]: [MobHunting][Debug] Basic Prize=$1 for killing a Chicken
[23:46:10 INFO]: [MobHunting][Debug] Checking if player is grinding within a range of 15.0 blocks
[23:46:10 INFO]: [MobHunting][Debug] Last Kill Area Center was null. DampendKills reset to 0
[23:46:10 INFO]: [MobHunting][Debug] Multiplier: Rank = 1.05
[23:46:10 INFO]: [MobHunting][Debug] Killstreak=1, level=0, multiplier=1.0
[23:46:10 INFO]: [MobHunting][Debug] RecordAchievement: hunting-level7-chicken has 95 kills
[23:46:10 INFO]: [MobHunting][Debug] RecordKill: Rocologo killed a Chicken (Minecraft) Cash=$1.20
[23:46:10 INFO]: [MobHunting][Debug] $1.40 was dropped on the ground as item SKULL (# of rewards=1)
[23:46:10 INFO]: [MobHunting][Debug] If 0.9020218962359061<0.025 Rocologo will get a McMMO Level for Archery
[23:46:10 INFO]: [MobHunting][Debug] Command will be run if chance: 0.05 > 0.5870400364465269 (random number)
[23:46:10 INFO]: [MobHunting][Debug] ======================= kill ended (37)=====================
[23:46:22 INFO]: [MobHunting][Debug] Saving PlayerStats to Database.
[23:46:23 INFO]: [MobHunting][Debug] Saved.
[23:46:31 INFO]: Rocologo issued server command: /spawnmob pig
[23:46:38 INFO]: [MobHunting][Debug] Refreshed 17 leaderboards.
[23:46:41 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[23:46:41 INFO]: [MobHunting][Debug] Rocologo killed a Pig (Minecraft)
[23:46:41 INFO]: [MobHunting][Debug] Permission 'mobhunting.mobs.
' or 'mobhunting.mobs.PIG' not set, defaulting to True.
[23:46:41 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a Pig
[23:46:41 INFO]: [MobHunting][Debug] Multiplier: Rank = 1.05
[23:46:41 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[23:46:41 INFO]: [MobHunting][Debug] RecordAchievement: hunting-level1-pig has 1 kills
[23:46:41 INFO]: [MobHunting][Debug] RecordKill: Rocologo killed a Pig (Minecraft) Cash=$0
[23:46:41 INFO]: [MobHunting][Debug] Reward was less than Rocologo (Bonuses=0.2)
[23:46:41 INFO]: [MobHunting][Debug] Command will be run if chance: 0.05 > 0.7490835603170933 (random number)
[23:46:41 INFO]: [MobHunting][Debug] ======================= kill ended (37)=====================

commented

It looks like the second one has a mob-cmd-run, so the kill and achievement should be counted nomatter show-achievements-without-reward

commented

show-achievements-without-reward: true
Achievement kill count is working

[10:21:35 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[10:21:35 INFO]: [MobHunting][Debug] vilgrar killed a SkeletonHorse (Minecraft)
[10:21:35 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a SkeletonHorse
[10:21:35 INFO]: [MobHunting][Debug] vilgrar has no Rank Multiplier
[10:21:35 INFO]: [MobHunting][Debug] Multiplier: Difficulty = 0.75
[10:21:35 INFO]: [MobHunting][Debug] Multiplier: Sneaky! = 2.0
[10:21:35 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[10:21:35 INFO]: [MobHunting][Debug] RecordAchievement: hunting-level3-skeletonhorse achieved.
[10:21:35 INFO]: CONSOLE issued server command: /give vilgrar gold_ingot 20
[10:21:35 INFO]: Giving 20 of gold ingot to vilgrar.
[10:21:35 INFO]: [MobHunting][Debug] RecordKill: vilgrar killed a SkeletonHorse (Minecraft) Cash=$0
[10:21:35 INFO]: [MobHunting][Debug] Reward was less than vilgrar (Bonuses=0.01)
[10:21:35 INFO]: [MobHunting][Debug] Command will be run if chance: 0.05 > 0.3414920574946566 (random number)
[10:21:35 INFO]: [MobHunting][Debug] ======================= kill ended (37)=====================

show-achievements-without-reward: false
Achievement kill count is still working?

[10:24:50 INFO]: [MobHunting][Debug] ======================== New kill ==========================
[10:24:50 INFO]: [MobHunting][Debug] vilgrar killed a SkeletonHorse (Minecraft)
[10:24:50 INFO]: [MobHunting][Debug] Basic Prize=$0 for killing a SkeletonHorse
[10:24:50 INFO]: [MobHunting][Debug] vilgrar has no Rank Multiplier
[10:24:50 INFO]: [MobHunting][Debug] Multiplier: Difficulty = 0.75
[10:24:50 INFO]: [MobHunting][Debug] Multiplier: Sneaky! = 2.0
[10:24:50 INFO]: [MobHunting][Debug] Killstreak=0, level=0, multiplier=1.0
[10:24:50 INFO]: [MobHunting][Debug] RecordAchievement: hunting-level4-skeletonhorse has 8 kills
[10:24:50 INFO]: [MobHunting][Debug] RecordKill: vilgrar killed a SkeletonHorse (Minecraft) Cash=$0
[10:24:50 INFO]: [MobHunting][Debug] Reward was less than vilgrar (Bonuses=0.01)
[10:24:50 INFO]: [MobHunting][Debug] Command will be run if chance: 0.05 > 0.4074658769600674 (random number)
[10:24:50 INFO]: [MobHunting][Debug] ======================= kill ended (37)=====================

commented

Also - show-achievements-without-reward - is only about showing the statistics. Killings and achievements is counted unless the reward is 0 or mob_level1=0

commented

Um, ok? I thought the (secondary) point of this issue was to enable or disable killings/achievements for 0-prize mobs. If that is not what we've been doing, I know nothing anymore.

commented

Well ...I understand why you are confused :-)... show-achievements-without-reward is only about if it is shown in the GUI... the feature was made for one user, who didn't want any rewards, but would like to count kills and achievements and see this in the gui.... maybe i should make a note in the config.yml about this.

To be honest I feel that removing the counting of killings and achievements is like removing some of the fun in this plugin :-)

commented

The way to stop the counting is to remove all rewards (not only money, but also mob_cmd and McMMO level reward)

And THEN if you still want to see and count the killings and achivements you must set show-achievements-without-reward: true

commented

The code is basically

IF Mob has any reward OR show-achievements-without-reward
THEN
Count kill and Achivements
ELSE
Do nothing

commented

SpigotMC 1.12 was released today, so I decided to release MobHunting V4.9.4 too - it has a lot of new features + a lot fixed bugs. I have not changed the Achievements since yesterday.

And it is unclear to me if you are okay with the release or if we need to take it a step further? :-)

commented

Nah, personally the 0-prize was never a problem for my own server (I want to reward my players for every kill, even passive mobs). If you're happy with the fix then let's close this issue.