• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Sword and Shield-Style Berry Tree System

v21.1 Sword and Shield-Style Berry Tree System 1.0

This resource pertains to version 21.1 of Pokémon Essentials.
Pokémon Essentials Version
v21.1 ✅
Also compatible with
  1. v20.1

Berry Tree System — Sword and Shield Style​

While looking for scripts that replicated the Berry Tree system in Pokémon Essentials, I came across several attempts scattered across forums and projects. Unfortunately, most of them were outdated for the latest Essentials versions or only partially recreated the mechanics from Pokémon Sword and Shield.
With that in mind, I developed my own plugin for Essentials 21.1 that accurately and flexibly simulates the Berry Tree mechanic from Sword and Shield. Players can shake trees, collect berries (or rare items), choose to keep shaking or stop, and get ambushed by a wild Pokémon that steals some of the collected items. The whole logic is configurable and easy to adapt to your project.
Example of how it works


Features​

  • Fully-featured Berry Tree system inspired by Sword and Shield, including:
    • Multiple shakes per tree
    • Random berry drops per shake
    • Chance for a wild Pokémon to appear after too many shakes
    • Wild Pokémon can steal collected berries
    • Chance to obtain rare items
  • Automatic tree reset system based on hours or days (fully configurable) and also compatible with the Unreal Time System plugin
  • Included sound effects: two SE called "BerryTreeDrop" and "BerryTreeShake (located in Audio/SE)
  • Highly customizable via script (Config), including:
    • Berries per tree
    • Maximum shakes per session
    • Wild encounter probability
    • Tree reset timing
    • Berries dropped per shake
    • List and chance of rare items


Installation and Usage​

Installation​

  1. Download the plugin using the provided link.
  2. Extract the contents of the .zip file into your Essentials project root folder.
  3. Make sure the Plugins and Audio folders are merged with the corresponding folders in your project.

Basic Usage​

To use a berry tree in your game, add the following command to a tree event:

pbBerryTree(id)

Replace id with a unique number to identify that specific tree. This number is used internally to track its state and configuration.
If you want to manually reset a tree’s cooldown (for testing purposes or through an in-game event), you can use:

pbResetBerryTree(id)

This will reset the tree with the given id as if a full reset period has passed, making it immediately available for shaking again.

Configuration Guide​

Open the plugin script named BerryTreeConfig to customize behavior. Here's what each setting does:
  • TREE_BERRIES
    Assign which berries can drop from each tree.
    Example:
    Ruby:
    Expand Collapse Copy
    TREE_BERRIES = {
      1 => [:ORANBERRY, :SITRUSBERRY],
      2 => [:PECHABERRY, :LEPPABERRY]
    }
  • ENCOUNTER_TYPE
    Type of wild encounter triggered when a Pokémon appears. Must match an encounter type defined in encounters.txt.
  • BERRY_TREE_VAR
    The variable ID used to store tree states. Reserve this variable and don’t use it for other purposes.
  • RESET_TYPE / RESET_TIME
    Sets how often a tree resets.
    Example:
    Ruby:
    Expand Collapse Copy
    RESET_TYPE = :days
    RESET_TIME = 1
  • This resets the tree after 1 day.
  • MAX_SHAKES_RANGE
    Defines the maximum number of shakes (randomized within the range).
  • ENCOUNTER_CHANCE
    Probability (from 0.0 to 1.0) of a wild Pokémon appearing during a shake.
  • STEAL_RATIO
    Proportion of collected berries that may be stolen when a Pokémon appears (from 0.0 to 1.0).
  • BERRIES_PER_SHAKE_RANGE
    How many berries drop per shake (randomized within the range).
  • RARE_ITEM_CHANCE
    Chance of a rare item dropping at any time during shaking.
  • RARE_ITEMS
    List of possible rare items that can drop.
To enable wild Pokémon to appear from berry trees, you must add a new section in your PBS/encounters.txt file like this:
Code:
Expand Collapse Copy
BerryTree
    25,CATERPIE,2,4
    20,WEEDLE,2,4
    15,PIDGEY,3,4
    15,RATTATA,3,4
    10,METAPOD,3,5
    10,KAKUNA,3,5
    5,PIKACHU,3,6

Feel free to adjust Pokémon species, levels, and chances to fit your project.


Credits​

While there are other scripts that attempt to recreate this mechanic, this plugin was built entirely from scratch and does not borrow code from any previous system. As such, full credit should be given to me.
Credits
Liszt
  • Like
Reactions: PokemonTrident
Author
Liszt
Downloads
178
Views
1,024
First release
Last update

Ratings

0.00 star(s) 0 ratings
Back
Top