mc.roleplayhub.com

players online

[Devlog #4] Writing a treasure finding plugin

Laplace64

Level 3
1737564189951.png

Okay! I am back again with a terrible sleep schedule and making questionable life decisions.

Some context! I found this really cool post by @Oliverium and I thought the idea was fun
https://schoolrp.net/threads/profitable-hobbies-metal-detecting-more.79936/

Basically, Oliverium wanted more ways we can earn money. One of them was.. metal detecting, with those big weird devices to scan for stuff in the sand.
So.. fueled with having a free evening, let's learn how to write a bukkit plugin!


The features implemented in the video is
  • You can turn on/off metal detectors with right-click
  • If you switch off the metal detector, it'll automatically shut it
  • The closer you are to a treasure spot, the faster it beeps. This sound is per-player only, no one else will hear it
  • When you stand over the treasure spot, you will be notified in chat and a dig-able spot will spawn
    • The dig spot is only spawned after a pleasure successfully locate a treasure spot, you can't just randomly dig tiles
  • You can use a shovel to retrieve the dig spot's loot
    • You can't spam click it, it will only yield one
  • The loot will spawn in your off-hand

Disclaimer I got my knowledge from crawling through random code a few hours in my late-diagnosed ADHD spree, and this is my first time learning Kotlin as well, so the code below should probably not be held in high regards

For developers to go through my code, it's completely open here!
github.com/Laplace64/treasurePlugin




The development part

If this were to be adopted in any way into SRP, a lot of things to be considered would be on balancing, so I'd like to leave a few open-ended questions for the community in case any SRP developers might want to take note of them

  • Location
    • Should this only be possible on beaches?
    • How should the treasure spot be spread out, and how should they be generated?
  • Frequency
    • How often can someone go metal detecting?
    • How long should it take on average to find something you can sell?
    • How long should it take for new treasure spots to regenerate?
  • Mechanics
    • Should shovels have limited usages to offset how much money someone can earn?
    • Should there be a limit on how much someone can make in a day?
    • Would this be intrusive to people looking to roleplay on the beach and potentially seeing ten people roaming around with metal detectors?

Future plans are
  • Hopefully nicer visual changes to loots
  • Actually make the treasure spot spawn randomly near you (will be on sand blocks only)
  • Make a fake npc that you can sort of sell things to for a mock demo
  • Any cool suggestions/rework that come up in this thread

Thank you for reading through my post! This is a short one today, as I am completely EXHAUSTED from learning about new things.
And.. there would probably be updates if this is something the SRP community wants to see?
 

Attachments

  • 1737564551532.png
    1737564551532.png
    100.3 KB · Views: 0
  • 1737564941608.png
    1737564941608.png
    242.3 KB · Views: 0
  • 1737565065569.jpeg
    1737565065569.jpeg
    15 KB · Views: 0
Last edited:

Customable

Level 148
Administrator
School Clubs Lead
Content Team
Customable
Customable
Omega+
Devlog #5 - Executing the communist regime and establishing a new order of operations using the power of C++ ✨
 

ErikFinster

Level 201
ErikFinster
ErikFinster
Omega+


that is exactly what I was hoping for . . . yes yes - this is very pleasing!

ദ്ദി ˉ͈̀꒳ˉ͈́ )✧
 

Users who are viewing this thread

Top