give me code
also can sppawn villager with that in any server and wihtout mod like vanilla work with trade
--- 📎 Attached 1 file(s):
File: pasted-code-1792589399964.txt
# VillagerNBT — Minecraft 26.3
Create a Minecraft 26.3 villager-management system with a vanilla-style inventory GUI inspired by the supplied trading GUI screenshot.
**Platforms**
- Fabric mod for Minecraft 26.3.
- Paper plugin with equivalent server-side features.
- Keep the interfaces and saved-data format consistent where practical.
**Commands**
- `/villagernbt create <name>` — create a managed villager.
- `/villagernbt remove <name>` — remove a saved villager after confirmation.
- `/villagernbt list` — open a list of managed villagers.
**GUI**
- Large chest-style interface with a scrollable villager list on the left and settings on the right.
- Display the selected villager's name and appearance.
- Use vanilla item icons, tooltips, barrier buttons and confirmation screens.
- Include the player inventory at the bottom.
**Settings**
1. Name editor supporting legacy `&` color codes and MiniMessage gradients.
2. Ender pearl button to move/teleport the managed villager.
3. Baby variant toggle.
4. Profession selection menu.
5. Biome variant selection: plains, desert, jungle, savanna, snowy, swamp and taiga.
6. Bone button to delete the selected villager after confirmation.
7. Save settings automatically when changed.
**Interaction**
- Shift + right-click a managed villager: open its settings/summon menu.
- Shift + left-click a managed villager: pick it up as a custom egg-like item containing its saved configuration.
- Right-click a block with the custom item: spawn the saved villager at a safe position near the clicked block.
- Do not trigger these interactions on ordinary, unmanaged villagers.
- Prevent accidental item duplication and loss during pickup or spawning.
**Data**
- Assign each managed villager a unique ID.
- Persist templates and settings across restarts.
- Store a versioned data format and validate it before spawning.
- Preserve supported properties, including name, profession, biome variant and baby state.
**Implementation**
- Use the correct official Minecraft 26.3 Fabric toolchain and APIs.
- Use Paper API for the Paper implementation rather than assuming Fabric client code runs on a server.
- Keep common data logic separate from platform-specific code.
- Provide complete source code, Gradle build files, plugin metadata, installation instructions and tested build commands.
- Do not use fake or placeholder APIs. Document any properties that cannot be reliably restored on a server without the required mod/plugin.
Build the simplest working version first: commands, GUI, name editing, profession/variant selection, pickup and placement. Add the remaining options after those work.


Build a vanilla datapack function that summons a villager with real vanilla trades.
Make the server-side requirement explicit: no code can add this to an arbitrary server unless its owner installs the datapack or a server mod/plugin.
Created a vanilla 26.3 datapack that summons a persistent librarian with three real trades. Run:
/execute at @s run function villagernbt:summon
The server owner must install the datapack in the world first. It works without a client mod on vanilla and datapack-compatible servers, but not on an arbitrary server that hasn’t installed it—a client cannot create server-side villagers or trades by itself.
This provides the vanilla summon-and-trade portion, not the full management GUI, pickup, or saved-template system from the attached spec. Installation steps and the trade definitions are in README.md and data/villagernbt/function/summon.mcfunction.
summon minecraft:villager ~ ~ ~ {CustomName:'{"text":"Shopkeeper","color":"green"}',CustomNameVisible:1b,PersistenceRequired:1b,VillagerData:{type:"minecraft:plains",profession:"minecraft:librarian",level:5},Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:3},sell:{id:"minecraft:diamond",count:1},maxUses:9999999,rewardExp:false,priceMultiplier:0.0f,xp:0},{buy:{id:"minecraft:gold_ingot",count:8},sell:{id:"minecraft:emerald",count:1},maxUses:9999999,rewardExp:false,priceMultiplier:0.0f,xp:0},{buy:{id:"minecraft:amethyst_shard",count:12},sell:{id:"minecraft:golden_apple",count:1},maxUses:9999999,rewardExp:false,priceMultiplier:0.0f,xp:0}]}}