Git Product home page Git Product logo

hunt's Introduction

Cobblemon Hunt

GitHub

A hunt mod for Cobblemon. Allows players to gain money from hunting specific Pokemon.

Features

  • Get paid for capturing Pokemon.
  • Configurations for:
    • Hunt duration
    • Amount of Hunt Pokemon
    • Prices per rarity
    • Properties (Ability, Gender, Nature, Shiny)
    • Custom prices for specific Pokemon

Installation

This mod can be ran on both Fabric and Forge. It has a few dependencies:

Screenshots

Hunt Screen Hunt Pokemon

Documentation

See the wiki.

License

MIT

Authors

hunt's People

Contributors

bencrow11 avatar victorienxp avatar

Stargazers

poqdavid avatar

Watchers

poqdavid avatar

hunt's Issues

Server Crash on catch

When a player catches a pokemon listed in the hunt menu, the server crashes with this error:

[00:30:46] [Server thread/ERROR]: Encountered an unexpected exception java.lang.IllegalArgumentException: sender cannot be null at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?] at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:877) ~[banner-1.20.1-578-server.jar:?] at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:51) ~[banner-1.20.1-578-server.jar:?] at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:841) ~[brigadier-1.1.8.jar:?] at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:177) ~[brigadier-1.1.8.jar:?] at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:142) ~[brigadier-1.1.8.jar:?] at org.pokesplash.hunt.util.Utils.runCommands(Utils.java:327) ~[Hunt-1.0.7-fabric.jar:?] at org.pokesplash.hunt.event.EventHandler.lambda$registerEvents$0(EventHandler.java:55) ~[Hunt-1.0.7-fabric.jar:?] at com.cobblemon.mod.common.api.reactive.ObservableSubscription.handle(ObservableSubscription.java:17) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.api.reactive.SimpleObservable.emit(SimpleObservable.java:39) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity$shakeBall$1.invoke(EmptyPokeBallEntity.java:442) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity$shakeBall$1.invoke(EmptyPokeBallEntity.java:336) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.util.DistributionUtilsKt.runOnServer$lambda$0(DistributionUtilsKt.java:49) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:102) ~[server-intermediary.jar:?] at com.cobblemon.mod.common.util.DistributionUtilsKt.runOnServer(DistributionUtilsKt.java:49) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.api.scheduling.SchedulingFunctionsKt$after$1.invoke(SchedulingFunctionsKt.java:16) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.api.scheduling.SchedulingFunctionsKt$after$1.invoke(SchedulingFunctionsKt.java:14) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.api.scheduling.ScheduledTask.update(ScheduledTask.java:66) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.api.scheduling.ScheduledTaskTracker.update(ScheduledTaskTracker.java:20) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.Cobblemon$initialize$1$1.invoke(Cobblemon.java:263) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.Cobblemon$initialize$1$1.invoke(Cobblemon.java:263) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.api.reactive.ObservableSubscription.handle(ObservableSubscription.java:17) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.common.api.reactive.SimpleObservable.emit(SimpleObservable.java:39) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at com.cobblemon.mod.fabric.CobblemonFabric.initialize$lambda$7(CobblemonFabric.kt:431) ~[Cobblemon-fabric-1.4.1+1.20.1.jar:?] at net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents.lambda$static$2(ServerTickEvents.java:43) ~[fabric-lifecycle-events-v1-2.2.2+1802ada577-64bb13225b65065c.jar:?] at net.minecraft.server.MinecraftServer.handler$cfi000$fabric-lifecycle-events-v1$onEndTick(MinecraftServer.java:4284) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:847) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:2111) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:265) ~[server-intermediary.jar:?] at java.lang.Thread.run(Thread.java:840) ~[?:?]

My hunt mod config:

{ "individualHunts": true, "sendHuntEndMessage": true, "sendHuntBeginMessage": true, "huntDuration": 60, "huntAmount": 7, "rarity": { "commonPokemonRarity": 7.0, "uncommonPokemonRarity": 2.5, "rarePokemonRarity": 0.3 }, "rewards": { "common": { "price": 1.0, "commands": [ "cmi money give %player% 500" ] }, "uncommon": { "price": 2.0, "commands": [ "cmi money give %player% 600" ] }, "rare": { "price": 3.0, "commands": [ "cmi money give %player% 700" ] }, "ultraRare": { "price": 4.0, "commands": [ "cmi money give %player% 900" ] } }, "matchProperties": { "ability": true, "gender": true, "nature": true, "shiny": false }, "customPrices": [ { "species": "magikarp", "form": "", "price": 500.0 } ], "blacklist": [] }

Fabric 1.20.1

Server Crash - Cannot invoke "java.util.ArrayList.iterator()" because "commands" is null

Mod Version: 1.1.0
Cobblemon Version: 1.5
Fabric API Version: 0.90.7
GooeyLibs Version: 3.0.0
Impactor Version: 5.2.4

[22:42:30] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.class_148: Ticking entity
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:901) ~[server-intermediary.jar:?]
	at net.minecraft.class_3176.method_3813(class_3176.java:283) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:824) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:671) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265) ~[server-intermediary.jar:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.ArrayList.iterator()" because "commands" is null
	at org.pokesplash.hunt.util.Utils.runCommands(Utils.java:315) ~[Hunt-1.1.0-fabric.jar:?]
	at org.pokesplash.hunt.event.CaptureEvent.lambda$registerEvents$0(CaptureEvent.java:88) ~[Hunt-1.1.0-fabric.jar:?]
	at com.cobblemon.mod.common.api.reactive.ObservableSubscription.handle(ObservableSubscription.java:16) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.api.reactive.SimpleObservable.emit(SimpleObservable.java:39) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity$shakeBall$1.invoke(EmptyPokeBallEntity.java:474) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity$shakeBall$1.invoke(EmptyPokeBallEntity.java:326) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.api.scheduling.Schedulable$after$1.invoke(Schedulable.java:25) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.api.scheduling.Schedulable$after$1.invoke(Schedulable.java:23) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.api.scheduling.ScheduledTask.update(ScheduledTask.java:64) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.api.scheduling.SchedulingTracker.update(SchedulingTracker.java:27) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at com.cobblemon.mod.common.entity.pokeball.EmptyPokeBallEntity.method_5773(EmptyPokeBallEntity.java:305) ~[Cobblemon-fabric-1.5.0b6456+1.20.1-HEAD-468f848.jar:?]
	at net.minecraft.class_3218.method_18762(class_3218.java:739) ~[server-intermediary.jar:?]
	at net.minecraft.class_1937.method_18472(class_1937.java:480) ~[server-intermediary.jar:?]
	at net.minecraft.class_3218.method_31420(class_3218.java:385) ~[server-intermediary.jar:?]
	at net.minecraft.class_5574.method_31791(class_5574.java:54) ~[server-intermediary.jar:?]
	at net.minecraft.class_3218.method_18765(class_3218.java:353) ~[server-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:897) ~[server-intermediary.jar:?]
	... 5 more

The commands list on our rewards section is empty, which is likely causing this, but it only crashes sometimes, not after every catch.
Config:

{
  "individualHunts": false,
  "sendHuntEndMessage": true,
  "sendHuntBeginMessage": false,
  "huntDuration": 60,
  "huntAmount": 14,
  "rarity": {
    "commonPokemonRarity": 7.0,
    "uncommonPokemonRarity": 2.5,
    "rarePokemonRarity": 0.3
  },
  "rewards": {
    "common": {
      "price": 2000.0,
      "commands": []
    },
    "uncommon": {
      "price": 4000.0,
      "commands": []
    },
    "rare": {
      "price": 7500.0,
      "commands": []
    },
    "ultraRare": {
      "price": 12500.0,
      "commands": []
    }
  },
  "matchProperties": {
    "ability": false,
    "gender": false,
    "nature": false,
    "shiny": false
  },
  "customPrices": [
    {
      "species": "magikarp",
      "form": "",
      "price": 500.0
    }
  ],
  "blacklist": []
}

Issue regarding basculin (and as such likely minior and the like down the line)

/hunts shows Basculin without a specific colour-stripe, but catching a stripe that isn't the same as the one shown in the /hunts inventory doesn't reward the player (images attached).
If its not too much of an inconvenience could you please change the name to the full forme required (e.g. red-stripe-basculin, yellow-trail-minior, etc.) or make it not require a specific forme to hand the reward out.

image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.