Spigot Petting 1.3

Pet and heal your pet cats, dogs, horses and parrots, 1.7 - 1.18, Open Source and Free

  1. RandomUnknown submitted a new resource:

    Petting - Pet your cats, dogs and horses! Pet any mob in the game!

    Read more about this resource...
     
  2. Great minimalist plugin!

    I was hoping to suggest a couple features:

    1) Include a %chance value to cause damage to player when petting a mob (hostile or otherwise); Implementation could be petting an 'untrained' animal. A fork of this could be when the player pets the mob for X times within Y time period, the healing effect is removed and the pet is 'agitated', which could use the %chance damage if the player continues to pet. Adds a bit of more 'realistic atmosphere' to it imho.

    2) Instead of causing damage, if the player pets the mob X times within Y period it could cause the mob to do Z, with Z being anything from run around the player, run away from the player in excitement, attack the player in excitement, etc.

    Just a couple thoughts; either way it's a nice system as is and my playerbase seems to like the addition!
     
  3. Hello, I just updated my server to 1.16.4 and added this plugin at the same time. It seems to be working, but I'm receiving this error in my console when it is being used https://pastebin.com/NRumnW0L

    Thanks!
     
  4. Code (Java):
    [08:16:17] [Server thread/ERROR]: Could not pass event PlayerInteractEntityEvent to Petting v1.2
    java.lang.NoClassDefFoundError: net/minecraft/server/v1_16_R1/Entity
        at com.ranull.petting.animation.Animation.handAnimation(Animation.java:21) ~[?:?]
        at com.ranull.petting.manager.PettingManager.petEntity(PettingManager.java:48) ~[?:?]
        at com.ranull.petting.events.Events.onEntityInteract(Events.java:46) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor107.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.4.jar:git-Purpur-897]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.4.jar:git-Purpur-897]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.4.jar:git-Purpur-897]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:2232) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:49) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:6) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:43) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1205) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1198) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1174) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1018) ~[patched_1.16.4.jar:git-Purpur-897]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:180) ~[patched_1.16.4.jar:git-Purpur-897]
        at java.lang.Thread.run(Thread.java:832) [?:?]
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_16_R1.Entity
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:116) ~[patched_1.16.4.jar:git-Purpur-897]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111) ~[patched_1.16.4.jar:git-Purpur-897]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 23 more
     
    • Like Like x 1
  5. Hi. I fixed the problem with the console errors described by others that happens with versions 1.16.4 and 1.16.5. It was preventing the hand animation from working. It looks like the plugin just needed to be updated for those versions. The compiled JAR for the fixed plugin is here: https://gitlab.com/gregmturek/petting/-/releases/1.2.1. (I made a merge request so that the author can incorporate it into the official repository if desired. The commit with the changes can be found via the same link if you prefer to compile it yourself.)
     
    • Like Like x 2
    • Friendly Friendly x 1
  6. Hand animation doesn't work on 1.17
     
  7. Does this work on every version from 1.7 to 1.17? '^^
     
  8. Yeah, but for the really old versions you will need to change the sound ENUM in the config for that version, you can change it in the config and use the reload command, the plugin will still work without it but you will just have a message in console saying it's invalid.
     
  9. I could, I have used stuff like XSeries classes in the past, I didn't want to add too much unnecessary code when most people run the latest version anyway, I could even include a second config that gets saved for older versions. I may still introduce this, although people can just change the sounds themselves and it works fine, If I were to pick one I would probably go with a second config file as it would be less code.
     
  10. I could add these features, But I would probably create another plugin which adds them instead. I want to try and keep this plugin simple, it's a simple concept I don't need to over-complicate things for this plugin at-least, I may add simple features, like an event when you pet an animal so other plugins could listen to it, or run commands on pet, which you could link into other plugins that could add some features.

    Fixed in the latest version.

    Thank you for providing this while I was lacking with updates.
     
    • Like Like x 1