Akshan Shevon

i want a datapack like a portable xp farmsss its like i craft a thing and if i out taht automatically a farm generates like irongolem farm, suger cane farm, mob farm like that

Kodari AI
KodariToday at 6:08 am 5
PortableXpFarms
A datapack that adds craftable portable XP farm blocks. When placed, each block automatically generates a functional farm structure nearby, including iron golem farms, sugar cane farms, and mob farms. Players craft the farm item, place it, and the datapack spawns the complete farm with working collection systems, delivering XP and resources directly to the player. Farms are self-sustaining and can be picked up and relocated.

I’ll make three craftable farm kits. Drinking a kit will build a compact farm and start producing resources and XP nearby.

Created three portable farm kits: iron, sugar cane, and mob drops. They generate resources and XP automatically every 30 seconds while loaded—they don’t spawn actual golems or mobs.

Crafting: Put a honey bottle in the center of a crafting table, with four iron ingots, sugar cane, or rotten flesh above, below, and on either side. Drink the kit to deploy it.

Warning: Deployment replaces blocks in a 5×5 area around you. Choose a clear spot!

  1. Download the ZIP using the export button.

  2. Extract the portable_xp_farms folder into world/datapacks/.

  3. Run /reload, then /datapack list to verify it loaded.

  4. Run /function portable_farms:test to get one of each kit for testing.

Kodari can make mistakes. Review important code before using.
Files
portable_xp_farms
Code
21 147
portable_xp_farms/data/portable_farms/function/build/iron_at.mcfunction
fill ~-2 ~ ~-2 ~2 ~ ~2 minecraft:stone_bricks
fill ~-2 ~1 ~-2 ~2 ~1 ~-2 minecraft:iron_bars
fill ~-2 ~1 ~2 ~2 ~1 ~2 minecraft:iron_bars
setblock ~-2 ~1 ~ minecraft:iron_bars
setblock ~2 ~1 ~ minecraft:iron_bars
setblock ~-2 ~1 ~-1 minecraft:iron_bars
setblock ~-2 ~1 ~1 minecraft:iron_bars
setblock ~2 ~1 ~-1 minecraft:iron_bars
setblock ~2 ~1 ~1 minecraft:iron_bars
summon minecraft:marker ~0.5 ~1 ~0.5 {Tags:["pf_farm","pf_iron"]}
tellraw @s {"text":"Iron farm deployed! It produces iron and nearby XP every 30 seconds while loaded.","color":"green"}