MobHunting

MobHunting

114k Downloads

Add support for the Boss plugin

skerit opened this issue ยท 24 comments

commented

I'm using the Boss plugin to create custom mobs on my server.

While MobHunting basically works with this, it sees all my custom mobs as the type they are based on.

So if someone killed my "Armed Zombie" custom mob, MobHunting will say You killed a zombie, when I want it to be You killed an armed zombie or, in case of actual an actual boss, You killed Count Dracula

Could it be added?

commented

Yes, it looks like BOSS has the needed methods in the API, but I dont have BOSS and I dont want to buy it. If the dev will give a free copy I think I can add support.

commented

Great, I'll test it tonight.

commented

I see in the log that MobHunting is detecting Boss:

[01:37:29] [Server thread/INFO]: [MobHunting] Enabling Compatibility with Boss (3.4.13)

But when I actually kill a custom Boss mob, I actually get nothing from MobHunting. No rewards, no text in chat, no errors in console, ...

commented

Sorry. I forgot to say that you should enable debug information before killing a boss and then show me the output from the console.

/mh debug

commented

Because I dont have acces to Boss.jar (and only have access to BossAPI.jar) I cant only do limited testing. I can check if the plugin can compile, but I cant test if I get a reward if I kill a Boss mob.

So until I get a copy of boss.jar I will have to ask you to test my builds.

I have added support for Boss in this build

https://fractal.lindegaard.one:8181/job/MobHunting/918/

please try the build and keep an eye on errors in the server console. When I add support for new customs mobs I have to do alot, so I dont think I remembered everything in first build. Please be patient.

Let me hear the result.

commented

Alright :)
I enabled debug mode, but when I killed a Boss mob it didn't show anything.
Killing a vanilla mob worked, though:

[18:43:06 INFO]: [MobHunting] [Debug] ======================== New kill ==========================
[18:43:06 INFO]: [MobHunting] [Debug] skeritc killed a Skeleton (Minecraft)@(world:767,68,-83)
[18:43:06 INFO]: [MobHunting] [Debug] KillAllowed: Mob killed by skeritc was allowed by WorldGuard
[18:43:06 INFO]: [MobHunting] [Debug] Permission 'mobhunting.mobs.*' or 'mobhunting.mobs.SKELETON' not set, defaulting to True.
[18:43:06 INFO]: [MobHunting] [Debug] Basic Prize=2 Gold Ingots for killing a Skeleton
[18:43:06 INFO]: [MobHunting] [Debug] skeritc used a weapon: DIAMOND_SWORD
[18:43:06 INFO]: [MobHunting] [Debug] Checking if player is grinding within a range of 15.0 blocks
[18:43:06 INFO]: [MobHunting] [Debug] Kill not within 15.0 blocks from previous kill. DampenedKills reset to 0
[18:43:06 INFO]: [MobHunting] [Debug] skeritc has no Rank Multiplier
[18:43:06 INFO]: [MobHunting] [Debug] Killstreak=1, level=0, multiplier=1.0 
[18:43:06 INFO]: [MobHunting] [Debug] Reward rounded to 2.0
[18:43:06 INFO]: [MobHunting] [Debug] RecordAchievement: hunting-level1-skeleton has 18 kills
[18:43:06 INFO]: [MobHunting] [Debug] RecordKill: skeritc killed a Skeleton (Minecraft) Cash=2 Gold Ingots
[18:43:06 INFO]: [MobHunting] [Debug] Description to be send:You killed a Skeleton
[18:43:06 INFO]: [MobHunting] [Debug] 2 was dropped on the ground as item SKULL (# of rewards=0)
[18:43:06 INFO]: [MobHunting] [Debug] If 0.26711309241997705<0.04 skeritc will get a McMMO Level for SWORDS
[18:43:06 INFO]: [MobHunting] [Debug] The command did not run because random number (0.20845793576498972) was bigger than chance (0.05)
[18:43:06 INFO]: [MobHunting] [Debug] Did not drop a head: random(0.7999483167516179)>chance(0.05)
[18:43:06 INFO]: [MobHunting] [Debug] ======================= kill ended (37)=====================
commented

this sound VERY strange. you should see something in the log when you kill a Boss mob???? I could understand if something was wrong in the log, but not an empty log. Are you sure you didn't do anything wrong? :-)

anyway i really need the boss.jar file so I can test this. I cant think of anything I did wrong in the code.... although i probably did :-)

commented

Well MobHunting is still loaded & Boss is obviously loaded, so I don't know what I could have done wrong here :P I even see MobHunting say it has enabled Boss support.

I saw there are developer licenses available, are they also for sale? I wouldn't mind sponsoring you if that's the case :)

commented

Ok, I killed some more Boss mobs and suddenly I did get a Mobhunting notification, here's the output:

[09:13:57 INFO]: [MobHunting] [Debug] ======================== New kill ==========================
[09:13:57 INFO]: [MobHunting] [Debug] skeritc killed a Zombie (Minecraft)@(world:762,68,-64)
[09:13:57 INFO]: [MobHunting] [Debug] KillAllowed: Mob killed by skeritc was allowed by WorldGuard
[09:13:57 INFO]: [MobHunting] [Debug] Permission 'mobhunting.mobs.*' or 'mobhunting.mobs.ZOMBIE' not set, defaulting to True.
[09:13:57 INFO]: [MobHunting] [Debug] Basic Prize=0 gold for killing a Zombie
[09:13:57 INFO]: [MobHunting] [Debug] skeritc used a weapon: DIAMOND_SWORD
[09:13:57 INFO]: [MobHunting] [Debug] Checking if player is grinding within a range of 15.0 blocks
[09:13:57 INFO]: [MobHunting] [Debug] Kill not within 15.0 blocks from previous kill. DampenedKills reset to 0
[09:13:57 INFO]: [MobHunting] [Debug] skeritc has no Rank Multiplier
[09:13:57 INFO]: [MobHunting] [Debug] Killstreak=0, level=0, multiplier=1.0 
[09:13:57 INFO]: [MobHunting] [Debug] Reward rounded to 0.0
[09:13:57 INFO]: [MobHunting] [Debug] RecordAchievement: hunting-level2-zombie has 103 kills
[09:13:57 INFO]: [MobHunting] [Debug] RecordKill: skeritc killed a Zombie (Minecraft) Cash=0 gold
[09:13:57 INFO]: [MobHunting] [Debug] Description to be send:You killed a Zombie!
[09:13:57 INFO]: [MobHunting] [Debug] The money reward was 0 or less than 'minimum_reward: skeritc'  (Bonuses=0.01)
[09:13:57 INFO]: [MobHunting] [Debug] If 0.2058449903838906<0.4 skeritc will get a McMMO Level for SWORDS
[09:13:57 INFO]: [MobHunting] [Debug] skeritc was rewarded with 1 McMMO Levels for SWORDS
[09:13:57 INFO]: [MobHunting] [Debug] The command did not run because random number (0.20753410102240877) was bigger than chance (0.005)
[09:13:57 INFO]: [MobHunting] [Debug] Did not drop a head: random(0.4247583661735038)>chance(0.05)
[09:13:57 INFO]: [MobHunting] [Debug] ======================= kill ended (37)=====================
commented

I have asked for a free license, let see what the dev says.

commented

I got one now, so now I can start testing myself :-)

commented

not... i still can download a free license, but he wrote that i will get a copy.

commented

That's great :)

commented

Now I got a copy of Boss, so I can start testing. but my /Boss/bosses folder is empty? Do I need to make some before I can test? Can I get a test boss from you (it would be nice if it is easy to kill - while testing?)

commented

Yeah, you have to make them. There are commands for that, but I'll share one of my files:

I reduced to health to 5. You can get spawner eggs from the menu, btw: /b get NAME

Type: ZOMBIE
Custom_Name: Armed zombie
No_Spawn_Permission_Message: ''
Health: 5
Dropped_Exp: default
Potions: '[]'
Specific_Settings:
  Display_Name: false
  Glowing: false
  Invulnerable: false
  Gravity: true
  Can_Pickup_Items: true
  Silent: false
  Targetable: true
  Despawn_When_Far_Away: false
  Auto_Target: false
  Burns_Under_Sunlight: false
  Baby: false
Attributes:
  Armor Toughness: 1.0
  Knockback Resistance: 0.0
  Follow Range: 35.0
  Armor: 2.0
  Movement Speed: 0.24
  Zombie Spawn Reinforcements: 0.011
  Attack Damage: 3.0
Skills: '[]'
Death:
  Commands: '[]'
  Commands_For_Players: '[]'
  Reinforcements:
    Vanilla: '[]'
    Boss: '[]'
  Lightning: true
  Kill_Riding_Entity: true
  Inventory_Drops:
    Enabled: false
    Player_Limit: 5
    Time_Limit_Seconds: 10
Spawn:
  Commands: '[]'
Spawning:
  Worlds:
    world: 1%
  Biomes: {}
  Regions:
    Boss: []
    Towny: []
    Factions: []
    Residence: []
    Blacklist: false
    WorldGuard: []
  Conditions:
    Rain: false
    Thunder: false
    Light: 0 - 15
    Time: 13000 - 24000
    Height: 0 - 256
    Spawn_Under_Water: false
Sounds:
  Debug: false
  Remapped: {}
Riding: ''
Riding_Boss: ''
Spawner_Egg:
  Lore:
  - ' '
  - '&2&l< &7Left click for menu'
  - '&2&l> &7Right click to summon'
  Material: COD_SPAWN_EGG
  Glow: true
  Name: '&rSpawn {boss}'
Natural_Drops: false
Single_Drops: false
Damage_Multiplier: 1.0
Equipment:
  HELMET:
    item:
      ==: org.bukkit.inventory.ItemStack
      v: 1976
      type: IRON_HELMET
    dropChance: 0.0
  CHESTPLATE:
    item:
      ==: org.bukkit.inventory.ItemStack
      v: 1976
      type: LEATHER_CHESTPLATE
    dropChance: 0.0
  BOOTS:
    dropChance: 0.0
  Allow_Random: false
  HAND:
    item:
      ==: org.bukkit.inventory.ItemStack
      v: 1976
      type: IRON_SWORD
    dropChance: 0.0
commented

Thank you. What is the filename?

commented

This was "Armombie.yml"

commented

I think it works now.

[11:24:59] [Server thread/INFO]: [MobHunting][Debug] ======================== New kill ==========================
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Rocologo killed a Armombie (Boss)@(world:-85,63,-17)
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] KillBlocked: Rocologo is hiding in WG region with mob-damage=DENY, but MobHunting is allowed with flag mobhunting=allow
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Permission 'mobhunting.mobs.*' or 'mobhunting.mobs.ZOMBIE' not set, defaulting to True.
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Basic Prize=10 for killing a Armombie
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Rocologo used a weapon: IRON_SWORD
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Checking if player is grinding within a range of 15.0 blocks
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] GrindingManager: average kill time=0
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Last Kill Area Center was null. DampenedKills reset to 0
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Multiplier: World = 1.1
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Multiplier: Rank = 1.05
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Multiplier: Difficulty = 0.75
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Killstreak=1, level=0, multiplier=1.0 
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Reward rounded to 9.0
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] RecordKill: Rocologo killed a Armombie (Boss) Cash=9
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] Message to be send to player:You killed a Boss.
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] 9 was dropped on the ground as item SKULL (# of rewards=1)
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] If 0.6431065934785348<0.02 Rocologo will get a McMMO Level for SWORDS
[11:24:59] [Server thread/INFO]: [MobHunting][Debug] ======================= kill ended (37)=====================

Please test this build and let me know the result:
https://fractal.lindegaard.one:8181/job/MobHunting/924/

commented

@Rocologo Looking good! The mobs drop the correct amount of money & I see the custom message. I like the separate config file.

2 remarks:

  • /mh reload doesn't seem to reload the boss-rewards.yml config file
  • Boss mobs have a Custom_Name property, could that be used instead of the filename? Because now I always see "Armombie" instead of "Armed zombie" :)
commented

/mh reload will work in next build.

I will have to ask the dev about the mob.getName() in his API, it looks like it gives me the "internal name" instead of the name.

commented

new version released.

When I get the answer from Boss Dev I hope I can change the name in next release.

commented
commented

I have made an improvement for you. All known Bosses is now added to boss_rewards.yml when the server start. Use this build:
https://fractal.lindegaard.one:8181/job/MobHunting/935/

commented

I just got an answer from The dev. I wil make a new release where the custom names is shown
"Armed Zombie"