Jump to content

Using nbt with Give Player: wont work.


jkr

Recommended Posts

Here is my script:

command /disenchant:
	permission: command.disenchant
	trigger:
		if player's held item is enchanted:
			set {_tool} to player's held item
			set {_enchants::*} to enchantments of {_tool}
			send "&aSucessfully removed %{_enchants::*}% from tool!" to player
			disenchant player's held item
			give player enchanted book with custom nbt "{StoredEnchantments:%{_enchants::*}%}"
		else:
			send "&cYour item is not enchanted."

Whenever I reload the script everything works but the give effect statement.

I've tried looking it up but couldn't find anything.

My server is on 1.16.5 and I have SkRayFall, SkStuff, TuSKe, and SkQuery.

Link to comment
Share on other sites

On 9/3/2021 at 7:33 AM, jkr said:

Here is my script:

command /disenchant:
	permission: command.disenchant
	trigger:
		if player's held item is enchanted:
			set {_tool} to player's held item
			set {_enchants::*} to enchantments of {_tool}
			send "&aSucessfully removed %{_enchants::*}% from tool!" to player
			disenchant player's held item
			give player enchanted book with custom nbt "{StoredEnchantments:%{_enchants::*}%}"
		else:
			send "&cYour item is not enchanted."

Whenever I reload the script everything works but the give effect statement.

I've tried looking it up but couldn't find anything.

My server is on 1.16.5 and I have SkRayFall, SkStuff, TuSKe, and SkQuery.

The reason this doesn't work is because SkStuff has been abandoned by its original owner. And since it was only updated to 1.12, the NBT values and stuff broke once 1.13 released. I also wouldn't suggest using custom NBTs anymore and would go for metadata values or variables.

https://forums.skunity.com/threads/warning-try-to-avoid-nbt.6260/

Developer

 

Joined Minecraft in 2010 on PC

Joined Minehut in August 2016

1 year Skript experience

2 months Java experience

5 months Javascript experience

 

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...