rouckz_playzz.
📎 1 file 1,227 chars
📄
pasted-code-1779523264503.txt
txt 39 lines
▶
Create a complete working Skript plugin script for Minecraft Paper 1.21.4 using Skript + SkBee.

Goal:
When a player fishes, they should receive a completely random Minecraft item/block/armor/tool/mob-related item from ALL items that exist in Minecraft.

Requirements:

- Cancel vanilla fishing loot completely.
- On successful fishing, give the player one random item from all Minecraft items/blocks.
- Include everything:
  - blocks
  - tools
  - armor
  - food
  - weapons
  - spawn eggs
  - decorative blocks
  - rare items
  - nether/end items
  - utility items
- Use Minecraft registry or all available items automatically instead of manually listing items.
- Make it compatible with Skript + SkBee.
- Remove/blacklist admin or broken items:
  - command block
  - repeating command block
  - chain command block
  - structure block
  - jigsaw block
  - debug stick
  - barrier
  - light block
- Fishing should work only when player catches something.
- Show chat message:
  “You got: ”
- Must work in Paper 1.21.4.
- Must not throw Skript syntax errors.
- Give me the final .sk file code only.

Also explain where to paste the script and how to reload it using /sk reload.
Kodari AI
KodariMay 23 at 8:02 am 5,881 (v2)
RandomFishingLoot
A Skript + SkBee fishing overhaul for Paper 1.21.4. Cancels all vanilla fishing loot and replaces it with a completely random Minecraft item drawn from the full game registry. Covers blocks, tools, armor, food, weapons, spawn eggs, decorative items, nether/end items, and more. Blacklists admin/broken items like command blocks and barrier blocks. Displays a chat message showing what the player caught.

Here’s the plan:

  • Use SkBee’s all minecraft items (registry expression) to pull every item dynamically — no manual lists

  • On fishing event with state caught fish or caught entity, cancel vanilla drops and give a random item

  • Filter out blacklisted admin/broken items before picking


📁 Where to place the file

  1. Navigate to your server folder

  2. Go to plugins/Skript/scripts/

  3. Drop random_fishing_loot.sk in there


🔄 How to reload

Once the file is in the scripts folder, run this in-game or from console:

Plain Text
/sk reload random_fishing_loot

You should see a confirmation in chat/console that the script loaded with 0 errors.


✅ How it works

Step
What happens
Player casts rod & catches something
fishing state
is
caught fish
or
caught entity
Vanilla loot is cancelled
cancel event
removes the normal fish/treasure drop
Registry is queried
all minecraft items
(SkBee) returns every item in the game
Blacklist is applied
Admin/broken items are filtered out via
isBlacklisted()
Random pick
A random index selects one item from the clean pool
Item given + message sent
Player receives the item and sees
[Fishing] You got: <item>!

📦 Requirements

Requirement
Version
Paper
1.21.4
Skript
2.9+
SkBee
3.x+ (for
all minecraft items
)

Note: The all minecraft items expression is provided by SkBee. Without SkBee installed and enabled, the script will fail to load. Make sure SkBee is in your plugins/ folder before reloading.

Kodari can make mistakes. Review important code before using.
Files
random_fishing_loot.sk
Code
1 60
random_fishing_loot.sk
# ======================================
# RandomFishingLoot
# Compatible: Paper 1.21.4 + Skript + SkBee
# Place in: plugins/Skript/scripts/
# Reload: /sk reload random_fishing_loot
# ======================================

options:
    prefix: &8[&b&lFishing&8]&r

# Blacklisted items that should never be given to players
function isBlacklisted(item: itemtype) :: boolean:
    if {_item} is command block:
        return true
    if {_item} is repeating command block:
        return true
    if {_item} is chain command block:
        return true
    if {_item} is structure block:
        return true
    if {_item} is jigsaw:
        return true
    if {_item} is debug stick:
        return true
    if {_item} is barrier:
        return true
    if {_item} is light:
        return true
    return false

on fishing:
    # Only trigger when the hook has caught something
    if fishing state is "caught fish" or fishing state is "caught entity":
        cancel event

        # Build a pool of all valid items from the Minecraft registry
        set {_all::*} to all minecraft items
        set {_pool::*} to {}

        loop {_all::*}:
            if isBlacklisted(loop-value) is false:
                add loop-value to {_pool::*}

        # Pick a random item from the pool
        set {_size} to size of {_pool::*}
        if {_size} is 0:
            send "{@prefix} &cNo valid items found in registry." to player
            stop

        set {_index} to random integer between 1 and {_size}
        set {_chosen} to {_pool::%{_index}%}

        # Give the item to the player
        give player 1 of {_chosen}

        # Format and send the message
        set {_name} to name of {_chosen}
        if {_name} is not set:
            set {_name} to "%{_chosen}%"
        send "{@prefix} &aYou got: &e%{_name}%&a!" to player