Skript

Skript

743k Downloads

Datapacks | Removing Enchantments error?

LisooYT opened this issue ยท 3 comments

commented

Skript/Server Version

I cant seem to use sk info cause of the error but its:
Skript 2.9.4/.5
Skbee: 3.6.3
Paper 1.21.1 Latest Build

Bug Description

So i removed every vanilla enchantment using new "filter" thingy (datapacks), skript didnt have any problems untill i added few ones back like Riptide, Unbreaking, Multishot thats when it showed the error, but when i added only the efficiency enchantment back it didnt show the error and skript worked idk what really happened here but maybe cause skript requires some enchantments or smth?

Expected Behavior

So it shouldnt show the error and skript should work, datapack that i made worked with skript normally but after adding few enchantments back cause i didnt want to remove every one of them skript suddenly showed an error and stopped working and disabled itself, it shouldnt just disable skript, and the vanilla enchantments should work with skript cause normally when i only added effickency enchantment back it worked and skript could check for it but for example: sharpness didnt work and that was the whole point to make almost every one of enchantments just dont exist it worked fine untill skript showed the errors and disables itself

Steps to Reproduce

I created a custom datapack and in pack.mcmeta i filtered "enchantment" folder
{ "pack": { "description": "Learn to Make Custom Enchantments!", "pack_format": 48 }, "filter": { "block": [{ "namespace": "minecraft", "path": "enchantment" }] } }
thats the code i have in pack.mcmeta it removes every enchantment
to add few enchantments back i created folders in the datapack so it should look like this:
data > minecraft > enchantment and in this folder you create files like: vanishing_curse.json efficiency.json
for example i'll give the code for efficiency.json:
{ "anvil_cost": 1, "description": { "translate": "enchantment.minecraft.efficiency" }, "effects": { "minecraft:attributes": [ { "amount": { "type": "minecraft:levels_squared", "added": 1.0 }, "attribute": "minecraft:player.mining_efficiency", "id": "minecraft:enchantment.efficiency", "operation": "add_value" } ] }, "max_cost": { "base": 51, "per_level_above_first": 10 }, "max_level": 5, "min_cost": { "base": 1, "per_level_above_first": 10 }, "slots": [ "mainhand" ], "supported_items": "#minecraft:enchantable/mining", "weight": 10 }
and for riptide.json:
{ "anvil_cost": 4, "description": { "translate": "enchantment.minecraft.riptide" }, "effects": { "minecraft:trident_sound": [ "minecraft:item.trident.riptide_1", "minecraft:item.trident.riptide_2", "minecraft:item.trident.riptide_3" ], "minecraft:trident_spin_attack_strength": { "type": "minecraft:add", "value": { "type": "minecraft:linear", "base": 1.5, "per_level_above_first": 0.75 } } }, "exclusive_set": "#minecraft:exclusive_set/riptide", "max_cost": { "base": 50, "per_level_above_first": 0 }, "max_level": 3, "min_cost": { "base": 17, "per_level_above_first": 7 }, "slots": [ "hand" ], "supported_items": "#minecraft:enchantable/trident", "weight": 2 }
and this is it

Errors or Screenshots

Screenshot_2024-11-26-18-19-16-93_40deb401b9ffe8e1df2f1cc5ba480b12
Screenshot_2024-11-26-18-19-03-59_40deb401b9ffe8e1df2f1cc5ba480b12
Screenshot_2024-11-26-18-18-49-98_40deb401b9ffe8e1df2f1cc5ba480b12
Screenshot_2024-11-26-18-18-36-69_40deb401b9ffe8e1df2f1cc5ba480b12
Screenshot_2024-11-26-18-18-13-86_40deb401b9ffe8e1df2f1cc5ba480b12
Screenshot_2024-11-26-18-17-52-37_40deb401b9ffe8e1df2f1cc5ba480b12

Other

If you guys could fix this or atleast tell me how to fix it i would really appreciate it.

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

Still exists on 2.9.5

commented

Yep i found the answer, skript checks for enchantments but once it feels that something is wrong it requires every enchantment i added the protection as it showed in the error then it told me to add fire protection and then its just every enchantment prob

commented

Skript likely assumes every vanilla enchantment already exists which needs to be fixed. Also your datapack is wrong, it should be "minecraft:mining_efficiency" not "minecraft:player.mining_efficiency"
I had to fix that to recreate the issue, maybe because I'm on 1.21.3