Create

Create

86M Downloads

Mechanical Villager Trader

BenGoldberg1 opened this issue ยท 1 comments

commented

Describe the Suggestion

There does not yet exist a fun way to automatically trade with villagers, and equally importantly, the Create mod doesn't yet have anything at all for this.

I'm aware of a variety of mods which lets you transform a villager from an entity to an item, then stick the item in a block, then trade with the block.

I'm hoping for an in-world solution, where Villagers stay entities, not become items.

A Mechanical Villager Trader could be a solution.

It would be made by shaped 3x3 crafting: a mechanical arm in the bottom-center, brass sheets on the left and right of the arm, andesite alloy above each brass sheet, an emerald in the top left, and a nugget of experience in the top right.

The block looks a bit like the Mechanical Arm, but the end of the arm has two grippers instead of one gripper.

Before being placed in the world, the player would give the machine several targets -- Villager job site blocks -- through a similar mechanism to how the player gives targets to Mechanical Arm.

Once placed in the world, the Mechanical Trade has a left and right input slot, and as many output slots as it needs to have. The left slot can be accessed from the block's left side, the right slot from the block's right side, and the output slots from below.

An item filter can be placed on the block's bottom, to restrict what trades the machine does.

When not in motion, an item from the left slot is displayed in the left gripper, and an item from the right slot is displayed in the right gripper.

As long as the machine has at least one item in either of it's input slots, it will attempt to trade with nearby villagers.

Specifically, it will trade with those villagers whose job site blocks the machine is targeting -- probably by querying the Point of Interest system.

When it does find a valid villager to trade with, the machine reaches out it's arm, trades the item(s) to the villager, and the arm retracts with the trade results in one gripper and experience in the other.

When the arm is fully retracted, these result items are moved it's grippers and into it's output slots, and the grippers are reloaded with items from the machine's left and right slots.

If a player right clicks on the either of the grippers with an empty hand, the items from that gripper are given to the player.

If the machine's arm was extending towards a villager when the player did this, the arm will punch the targeted villager, with the player as the injury source, then retract.

The Mechanical Villager Trader will not perform a trade if any of the following are true:

  • The Villager is too far away from the mechanical trader.
  • The Villager is sold out of the item.
  • The machine's output filter rejects the trade result.
  • The machine has at least one of the trade result inside of any of it's own output slots.
  • The machine is being Redstone powered.
  • The Villager's job site block is being Redstone powered.
  • The machine is not receiving rotational power.

The experience orbs that the villager would normally give the player become nuggets of experience. These being in the machine do not prevent it from trading, and the items traded from villagers go into lower-numbered output slots than the output slots holding these nugget of experience items.

If the player right clicks the base of the machine with an empty hand, the contents of the first non-empty output slot are given to him.

Depending on a Create config option, the Mechanical Villager Trader will record the UUID of the player who placed it, and do trades on their behalf, taking into account discounts or fines that player has; or they use some config-specified UUID (shared with deployers?) or they have no UUID until a player uses some item to copy their own UUID (or the item's UUID) into the machine.

Screenshots and Videos

No response

Additional Context

No response

commented

This would work as an addon but I doubt that this fits in Create's philosophy. Villager trading is probably not supposed to be automated. The Create team has said they didn't want deployers to be able to fish because it would be too OP to have infinite treasures with no efforts. Being able to trade with villagers without having to raise a finger is the same deal.