Skip to main content

Add a Backpack Type

This adds a Fishing Backpack: 27 slots, only fish, picks up its catch on its own, crafted from string, a fishing rod and a chest.

1. Add the type​

Open plugins/NexalBackpacks/config.yml and add a block under types:, at the same indentation as the other types:

types:
# ... the types already there ...

fishing:
display-name: "<aqua><bold>Fishing Backpack</bold></aqua>"
material: TROPICAL_FISH_BUCKET
lore:
- "<gray>Holds what you catch</gray>"
- "<gray>Capacity:</gray> <white>%slots% slots</white>"
- ""
- "<yellow>Right-click to open</yellow>"
slots: 27
soulbound: false
auto-pickup-default: true
whitelist:
- COD
- SALMON
- TROPICAL_FISH
- PUFFERFISH
blacklist: []
recipe:
enabled: true
type: shaped
shape:
- "SRS"
- "SCS"
- "SSS"
ingredients:
S: STRING
R: FISHING_ROD
C: CHEST

The quickest way to start is to copy a type that is close to what you want (farming here) and change it. Every key is explained in Backpack types explained.

2. Give it a menu (optional)​

Without a gui section the type gets the default menu. To give it its own colours, add one:

    gui:
title: "<gradient:#3498DB:#85C1E9><bold>Fishing Backpack</bold></gradient>"
rows: auto
filler:
material: LIGHT_BLUE_STAINED_GLASS_PANE
buttons:
auto-pickup:
material: TROPICAL_FISH
material-off: BONE

Design a backpack menu shows what else the menu can do.

3. Save and check​

  1. Save config.yml. With auto-reload: true it loads at once; otherwise run /backpack admin reload.
  2. Look at the console. Failed to load backpack type 'fishing' means a wrong material.
  3. Run /backpack admin types. fishing should be in the list with 27 slots.

4. Try it​

  1. /backpack admin give <your name> fishing.
  2. Right-click it: the menu opens with its own title.
  3. Put a fish in, then a stone: the stone is refused.
  4. Go fishing: the catch goes into the backpack.
  5. Craft one at a crafting table with the recipe above.

Common mistakes​

ProblemFix
The type is not in /backpack admin typesThe YAML is broken (check the indentation: two spaces, no tabs) or material is wrong. The console says which
Items you listed are refusedA misspelled name in whitelist is skipped without a warning. Use the exact material name
The recipe does nothingrecipe.enabled is not true, or a letter in shape has no entry in ingredients
Players cannot craft it while holding shiftOn purpose: backpacks are crafted one at a time