Dispenser Vilager Trading 图标

Dispenser Vilager Trading

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 v1.3
本资源为搬运资源,原资源地址: https://modrinth.com/mod/dispenser-vilager-trading
资源信息

Minecraft 版本: 1.21.10

平台: paper

标签: equipment game-mechanics utility

资源介绍

Dispenser Villager Trading

Dispenser Villager Trading is a Paper plugin that allows dispensers to perform villager trades automatically.
When a dispenser faces a villager and contains the required ingredients for one of the villager’s trades, it will automatically:

  • Select a valid trade (at random, preserving vanilla dispenser behavior),
  • Pay the cost using items from its inventory,
  • Drop the result behind the dispenser (or insert it into a chest located directly behind it),
  • Update villager experience and trade usage as if a player traded manually.

This plugin also adds a villager-only pressure plate that only villagers can activate.


Features

  • Dispenser trading: Dispensers can fulfill any available villager trade — including two-ingredient trades — using their own inventory. Villagers gain experience and trades lock/unlock as normal.
  • Player Experience: Players gain experience as if they traded manually when dispensers perform trades. Same as Furnace Experience.
  • Villager-only pressure plate: A custom craftable pressure plate (stone pressure plate + emerald) that only villagers can activate.

Public API (Event System)

A dedicated API module exposes events for other plugins.

The first event is:

DispenserVillagerTradeDepositEvent

This event fires whenever the plugin attempts to deposit a villager trade result into a chest.

Available methods:

public Inventory getSource();
public Inventory getDestination();

public ItemStack getItem();
public void setItem(ItemStack item);

public boolean isCancelled();
public void setCancelled(boolean cancel);

public HandlerList getHandlers();
public static HandlerList getHandlerList();

Requirements

  • Paper 1.21.10 (or any Paper build targeting the 1.21.10 API)
  • Java 21 runtime on the server

Installation

  1. Build the plugin JAR (see below) or download one from the releases page.
  2. Place the JAR into your server’s plugins/ directory.
  3. Start or reload your Paper server.

Building

This project uses Gradle. Common tasks:
You can build only the plugin JAR, copy it to a server, or run a local test server.

  • ./gradlew build — Builds the plugin JAR under plugin/build/libs/.
  • ./gradlew copyToServer — Builds the JAR and copies it to the server directory specified by SERVER_LOCATION in secrets.properties.

Configuration

The generated config.yml provides the following option:

  • allowVillagerDispenserInteractions (boolean):
    If false, dispensers will not fire when a villager stands in front of them unless a matching trade exists.
    Defaults to false.

Usage Tips

  • Place a dispenser facing a villager, load it with the required trade ingredients, and power it. The plugin selects a valid trade, consumes the payment, and outputs the result behind the dispenser.
  • Craft the villager-only pressure plate (stone pressure plate + emerald) to allow villagers — and optionally players — to activate contraptions while preventing other mobs from triggering them.
  • Place a chest directly behind the dispenser to automatically collect traded items.

Notes

The plugin is designed specifically for Paper and may not function correctly on other server types.

It aims to preserve core vanilla behavior while adding helpful mechanics:

  • Trades are selected randomly, matching vanilla dispenser behavior.
  • Villager experience and trade usage update normally.
  • Result items are dispensed naturally, as if fired by a dispenser.
  • Additional quality-of-life features:
    • Traded items are dispensed behind the dispenser so villagers don’t pick them up.
    • Chests placed behind the dispenser collect trade outputs automatically.
    • A villager-only pressure plate allows villager-driven redstone without mob interference.

Future Plans

  • Selecting a specific trade via redstone signal strength.
  • Moving the villager-only pressure plate to a dedicated plugin. Or adding more pressure plate types.
  • Add more events to the public API for deeper integration.
  • Add barrels support for trade result collection.
  • Add more configuration options to better mimic vanilla behavior.

Feedback and Contributions

Feedback, issues, and pull requests are welcome!
Visit the GitHub repository: DispenserVillagerTrading

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Tweakified Gear

价格:0 墨喵币
下载量:0

查看详情
ExpeditionCraft

价格:0 墨喵币
下载量:0

查看详情
World Downloader²

价格:0 墨喵币
下载量:0

查看详情
MiniEssentials

价格:0 墨喵币
下载量:0

查看详情