Is there any replacement for FishHook.setBiteChance?

Discussion in 'Spigot Plugin Development' started by A_Sad_Shoe, Jun 12, 2019.

  1. so i started working on a small mmo-style plugin where i wanted to implement a fishing system, and i would really like to be able to reduce the time it takes to reel in a fish depending on the rod my player has, his fishing level etc.

    but the setBiteChance method is currently deprecated and i dont see a replacement for it, i know i can implement what i want using NMS, but would rather avoid it as this is my first ever plugin, and i would prefer not having to spend 80% of my time analyzing the alphabet when i'm still learning the ropes.

    if there's nothing to do i'll just have to bite the bullet and go for NMS, but in case there's a workaround it would be great.

    thanks in advance.
  2. As fish are now entities rather then simply appearing from thin air I guess how this happens changed a lot in 1.13. Is there as reason not to use the LURE enchantment which should do the right thing (no sure when it maxes out)?

    I would *guess* the fish AI now comes into play and you would need to modify that somehow.
  3. as for why i dont use LURE enchantment, from what i gathered, the LURE enchantment only takes 5 seconds per rank from the already generated value(5-45 seconds, so 5-30 seconds at max rank which is 3), i want my player to have a reduced fishing time based on the players fishing rank and the stats on the rod(custom item, for all intent and purposes i could make a wooden shovel shooting out a hook and use that, i don't want to depend on the standard rod though), and as a side note i would like to avoid the standard enchantments in most cases as that's how the rest of the plugin is being built.

    in terms of the fish ai, im not sure how i would access it, i know there's the little water sprinkle thing before a bite, which i might be able to get a hold of to speed up the bite, but im not sure how i get that from the event, as i only have access to the FishHook from the PlayerFishEvent, i'll try to see if i can get a hold of it and modify it, but from what i understood, most of the ai stuff can only be changed from the NMS version.
  4. Methods are deprecated for a variety of reasons. Deprecation doesn’t mean removal, it might just mean a planned rework of the method by Spigot. Use the Spigot method, not NMS.

    Also, fish still appear out of thin air, that had nothing to do with it.
  5. Reading the API docs it states the method doesn't do anything on latest versions of Minecraft.
  6. Good to know.

    From looking at server code, there is a NMS class called something like EntityBobber, and that stores hooked entities, but not fished items.

    I would suggest looking at the AutoFisher fabric mod for 1.14, and decompiling it. If you can find out what packet it uses to detect caught fish you can intercept it using ProtocolLib.