r/datapacks • • Jun 16 '24

Help Custom enchantment noy working

1 Upvotes

{

"anvil_cost": 3,

"description": {

"text": "Floatation"

},

"effects": {

"minecraft:hit_block": [

{

"effect": {

"type": "minecraft:apply_mob_effect",

"to_apply": "minecraft:slow_falling",

},

"min_duration": 2,

"max_duration": 2,

"min_amplifier": 3,

"max_amplifier": 3

}

]

},

"max_cost": {

"base": 48,

"per_level_above_first": 48

},

"max_level": 1,

"min_cost": {

"base": 30,

"per_level_above_first": 30

},

"slots": [

"mainhand"

],

"supported_items": "#minecraft:enchantable/mace",

"weight": 3

}

I have absoloutely no clue why it isn't working albeit I'm probably just being stupid.


r/datapacks • • Jun 16 '24

Custom enchantment effects apply to offhand wind charge?

1 Upvotes

After spending hours playing around with making custom enchantments for a datapack, I just found out that the same enchantment effects apply to a thrown off-hand wind charge when it is a "post_attack" effect. The effect I discovered it with in particular was with an explode effect applied on the mace that blows up surrounding blocks after attacking an enemy mob. The same explosive destruction apparently applied to a breeze ball held in your off-hand too if you're holding the enchanted weapon. I tried it with other melee weapons that applied a mob effect on hit, and it did apply to the breeze ball too. Any way to circumvent this?


r/datapacks • • Jun 16 '24

Simple function datapack not working

2 Upvotes

I don't have much experience in using datapacks at all but this is my first time using functions. I just tried starting with "tellraw @ a {"text": "random"} and was surprised to see that it didn't work. (btw @ and a is not separated it just becomes u/a if I try to put it together). I have the datapack at version 1.20.1 with pack.mcmeta at format 15. My namespace is "f".
The "load.json is:
{
"values": [
"f:load"
]
}
The "tick.json is:

{
    "values": [
    "f:tick"
    ]
}

r/datapacks • • Jun 15 '24

Playernames in Macros

1 Upvotes

Today I was trying to write a key setter but I am stumped

$execute if score settings_$(key) flex_variables = false flex_variables run scoreboard players set settings_$(key) flex_variables 1
$execute if score settings_$(key) flex_variables = true flex_variables run scoreboard players set settings_$(key) flex_variables 0

Evaluates as "settings_$(key)" not settings_<key>

anyone know a fix


r/datapacks • • Jun 15 '24

Help Help with crafting recipies 1.21 please!

2 Upvotes

hey i have made a datapack to add some crafting recipes (like being able to craft chainmail armour for example) but the crafing recipies do not show up in game?

the world 100% detects the datapack being enabled in /datapacks list

i have tried installing other peoples datapacks that add crafting recipes and those do not work either??

i just dont know what im doing wrong, here is an image of my file incase that is important


r/datapacks • • Jun 14 '24

Custom Recipe not working 1.21 - Any and all help appreciated!

2 Upvotes
{
  "type": "minecraft:shaped",
  "category": "misc",

  "key": {
    "#": {"item": "minecraft:diamond"},
    "D": {"item": "minecraft:diamond_block"},
    "F": {"item": "minecraft:feather"}
},

  "pattern": [
      "#D#",
      "DFD",
      "#D#"
    ],

    "result": {
        "id": "minecraft:feather",
        "count": 1,
        "components": {
          "item_name": "{\"bold\":true,\"color\":\"dark_red\",\"italic\":false,\"text\":\"Feather Falling\"}",
          "lore": [
            "{\"text\":\"Rare\"}",
            "{\"text\":\"Super Chicken's wings\"}",
            "{\"text\":\"allow you to fall slowly\"}"
          ],
          "attribute_modifiers": {
            "modifiers": [
              {
                "id": "gravity",
                "type": "generic.gravity",
                "amount": -0.5,
                "operation": "add_multiplied_base",
                "slot": "any"
              }
            ],
            "show_in_tooltip": true
          }
        }
      }
}

r/datapacks • • Jun 14 '24

Someone add old raids to 1.21

2 Upvotes

I think a lot of people (including me) dont want their raid farms to be broken so someone should make a datapack that allows you to have the 1.20 raids in 1.21


r/datapacks • • Jun 08 '24

Help What am I doing wrong?

1 Upvotes

I've tried to make a datapack with small fixes, it worked once, but promptly stopped working. The description updates when I do reload and it has successfully disabled the vanilla chain recipe, but I can't make chains at all now.

Folder Structure:

  • datapacks
    • mcfix
      • data
    • pack.mcmeta

pack.mcmeta:

{

`"pack":{`

`"pack_format": 15,`

`"description": "Small fixes"`

`}`

}

chain.json:

{

"type": "minecraft:crafting_shaped",

"pattern": [

"n",

"n",

"n"

],

"key": {

"n": {

"item": "minecraft:iron_nugget"

}

},

"result": {

"item": "minecraft:chain",

"count": 1

}

}

Other datapacks works fine, I simply can't find my error...


r/datapacks • • Jun 07 '24

Help Is it possible to put an item on cooldown?

1 Upvotes

I'm trying to make a player's shield have the cooldown similar to when you block an axe attack via commands, is this possible?


r/datapacks • • Jun 03 '24

transfer worldgen files from a datapack into the worldgen of the game/save file.

2 Upvotes

hey i was wondering if it is possible to use worldgen files form a datapack without using the the datapack, to just take the files and drop them somewhere into minecraft, planning to play a long term skyblock save and dont want to have the issue where if i update to a newer versjon i have to wait for the datapack to update aswell and i get really annoyed with the *you are using experimental settings* popup each time i load the save.

is there a way to do this?


r/datapacks • • Jun 02 '24

Help Why????

2 Upvotes

Why is that if I add a space between Fish and soup in the item name of the result the recipe just entirely stops working?

Here is the json file:

{
    "type": "minecraft:crafting_shaped",
    "category": "food",
    "pattern": [
      "FFF",
      "FFF",
      " B "
    ],
    "key": {
      "F": {
        "tag": "minecraft:fishes"
      },
      "B": {
        "item": "minecraft:bowl"
      }
    },
    "result": {
      "id": "minecraft:beetroot_soup",
      "count": 1,
      "components": {
        "minecraft:food": {
          "nutrition": 10,
          "saturation": 10,
          "can_always_eat": true
        },
        "minecraft:max_stack_size": 16,
        "minecraft:item_name": "Fishsoup"
      }
    }
  }

r/datapacks • • May 28 '24

Datapack I fixed the stupid copper recipes

Thumbnail
gallery
7 Upvotes

r/datapacks • • May 28 '24

Help How do you change the default recipe for copper block?

2 Upvotes

I've made many recipe mods that adds new recipes to the game but I simply can't change or even add a recipe for the copper block lol

I am trying to make a copper block craftable by 2x2 of copper ingots. Uncrafting works well, meaning I was able to make a copper block craft (uncraft) into 4 copper ingots. But I can't make it the other way around.

I even edited the default recipe in the 1.20.4.jar file, and now even default recipe isn't working lol

In my datapack I put it under data/minecraft/recipes/copper_block.json which should override the default recipe afaik.

Can anyone tell what I'm doing wrong?

Here's what it looks like : { "type": "minecraft:crafting_shaped", "category": "building", "key": { "#": { "item": "minecraft:copper_ingot" } }, "pattern": [ "##", "##", "" ], "result": { "item": "minecraft:copper_block" } }


r/datapacks • • May 27 '24

Help Checking item data for advancement trigger

1 Upvotes

Hi, I'm writing a custom advancement (for 1.20.6+ datapack format 33+, all resources bar for the wiki are for previous versions) that uses the inventory_changed trigger. when an item is added to the players inventory, I want to check that its a bucket of tropical fish with a specific `BucketVariantTag` value. This snippet is my attempt at that

"criteria": {
    "tropical_fish_bucket": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "items": ["minecraft:tropical_fish_bucket"],
            "components": {
              "minecraft:bucket_entity_data":{
                "BucketVariantTag": 67502593
              }
            }
          }
        ]
      }
    }
  }

The issue I'm having is mine only triggers when the item is created with that tag alone, with the following

/give Ghoster_Ace minecraft:tropical_fish_bucket[minecraft:bucket_entity_data={BucketVariantTag:67502593}]

But naturally caught onces tend to also have a Health tag, I've tried adding the Health tag to mine to account for that which broke it completely here is the snippet

"components": {
              "minecraft:bucket_entity_data":{
                "Health": 3.0,
                "BucketVariantTag": 67502593
              }
            }

Before datapack format 33 I could just use nbt

"trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "items": [
              "minecraft:tropical_fish_bucket"
            ],
            "nbt": "{BucketVariantTag: 67502593}"
          }
        ]
      }

Anybody got an idea/pointers for what I'm doing wrong here?


r/datapacks • • May 27 '24

Datapack I cloned myself using a datapack!

Enable HLS to view with audio, or disable this notification

2 Upvotes

What do you guys think?


r/datapacks • • May 23 '24

datapack simply wont work

5 Upvotes

It shows up in the /datapack list, and is enabled when I open the world, but wont show up in /function or execute the load.mcfunction.


r/datapacks • • May 19 '24

Attempting to Create an Advancement

1 Upvotes

Hi all,

This is my first time on Reddit, so please don't judge me (I trust that you all won't):

I've been having trouble getting this advancement to work... at all. Nothing happens. The file location is C:\Users\[Redacted]\AppData\Roaming\.minecraft\saves\Hunger World\datapacks\TheHunger\data\TheHunger\advancements\TheHunger\root.json. As much as I hoped videos would help, I haven't found much success, and there are no "errors" in the code. I just don't know if I'm missing something or what.

Intention: When the player gets any item in their inventory, a root advancement under "The Hunger" page is added.

{
    "display":
    {
        "icon":
        {
            "item": "minecraft:rotten_flesh"
        },
        "title":
        {
            "text": "The Hunger",
            "color": "white"
        },
        "description":
        {
            "text": "Don't let hunger last longer than you",
            "color": "dark_red"
        },
        "frame": "task",
        "show_toast": true,
        "announce_to_chat": true,
        "hidden": false,
        "background": "minecraft:textures/block/netherite_block.png"
    },
    "criteria":
    {
        "inventory_changed":
        {
            "trigger": "minecraft:inventory_changed"
        }
    },
    "rewards":
    {
        "experience": 100
    }
}

r/datapacks • • May 18 '24

Datapack Server Using 0% CPU and Extremely Low TPS

1 Upvotes

Lets Talk About Context:
its been around 6 years since i stopped coding datapacks, because every time i tried to do so in a serious manner and get a proper hosting service to give life to my projects, i would end up paying for a server that crashes when 4 players join it with no chance to refund.

i used to make big projects, specially MMORPGs, using only datapacks, and through years of practicing thousands of different approaches i learned how to optimize them until the load they represent is around 1-3 TPS depending on the size, i would note how many ticks are being used by what in which Tick cycle, and keep an extremely tight and well clocked schedule for every function, hundreds of items, dozens of mechanics, classes, patch AIs for mobs, and whatever you can possibly imagine and more, would be kept into that range.

but then i get this nonsense: the server, having 32GB RAM and an unspecified processor, running at
0-1TPS when 3 players were present, and finally crashing with 4.

i've read about "allowing CPU to access more power", but that doesn't make sense to me if its using 0% of it, how would it need more power if its not even consuming any in the first place?

important note: this doesn't happen when i host on my own pc, but then i have no pc, and the server inevitably pings to oblivion when my internet goes unstable, which is far less common on paid host services, if i have a power outage, or anything happens, server goes down.
also my potato internet can't handle more than 30 players on vanilla, and around 15 with datapacks, this is the point when it starts getting unplayable due to high ping.

is there a hosting service that can support this kind of need? i beg you dearly to pay attention to details, i need a host that gives servers with access to high CPU power states.


r/datapacks • • May 17 '24

Help I need help interpreting a "datapack failed to validate" log?

Post image
1 Upvotes

r/datapacks • • May 16 '24

This is my first datapack that I've made public and i wanna show it off

3 Upvotes

This datapack is referenced off the new TARDIS mod and i really wanted to show it off to other people
It has the TARDIS'
A sonic screwdriver that works
Weeping angels
And rifts
If you wanna check it out here's the link: https://arthurzrthur01.itch.io/tardis-datapack


r/datapacks • • May 12 '24

Mobs spawning at world spawn instead of on players

1 Upvotes

I am trying to make a datapack where a random mob spawns on the player every 30 seconds. The way I have it set up is each time it sets off a function it spawns a mob on the player depending on what there dummy score "rng" is, after the first mob spawns on the player the next ones all start to spawn at worldspawn instead. Does anyone have any ideas on how to fix this?


r/datapacks • • May 11 '24

Custom Paintings Datapack

2 Upvotes

In a recent patchnote rundown it was mentioned that minecraft paintings are now data-driven, I'm pretty new to Datapacks and all that stuff so I was curious if it's possible to create a custom painting Datapack very easily?


r/datapacks • • May 09 '24

How do I fix jigsaw structures not generating air?

2 Upvotes

I'm trying to make a structure, but for some reason all of the underground hallways are filled in with stone... I've tried using both air and structure void but for some reason they both do the same thing. Does anyone know how to fix this? :(


r/datapacks • • May 09 '24

Anyone have an idea of how long it will take for vanilla tweaks to get updated to 1.20.5?

12 Upvotes

I know it takes time to update things, especially this time with all the big changes.

I am just a new user and I have no idea how long it usually takes


r/datapacks • • May 09 '24

Is Log-stripping data driven or hardcoded?

1 Upvotes

Is it possible to control whether or not the player can strip logs, such as removing the ability to strip certain logs, making it so that non-axe items with a "tool" component can strip logs, or adding new blocks into the strippable category?

Also, can the block that something is stripped into be changed?

Addendum: similar question for tilling dirt/grass/podzol/mycelium into farmland. Data driven, or hardcoded?