CraftTweaker

CraftTweaker

151M Downloads

[Suggestion][1.12.2] Give Command - useable for Commandblock

Xarmat-GitHub opened this issue · 7 comments

commented

Make "/ct give" command useable for commandblocks

At the moment the /ct give command works only in the chat, but when the command are to long, there is no simple way to realize it.

Original Command
/ct give <minecraft:stone>

Command for Commandblock
/ct give [PLAYER, @p] <ITEM>
(At the moment the commandblock outputs: [11:17:00] You do not have permission to use this command)

Opportunities
I try to work with Mods like "Tinkers Construct" or "Construct Armoury" to change values, but the commands get to long and dont fit in the chat any more.
/ct give <conarm:chestplate>.withTag({StatsOriginal: {Toughness: 0.0 as float, FreeModifiers: 3, Durability: 64, Defense: 3.0 as float}, Stats: {Toughness: 0.0 as float, FreeModifiers: 3, Durability: 64, Defense: 3.0 as float}, TinkerData: {Materials: ["wood", "wood", "wood"], Modifiers: []}, Modifiers: [{identifier: "ecological_armor", color: -7444965, level: 1}], Traits: ["ecological_armor"]})

Thanks for the nice Mod you created and have a great day.

Stay in Contact
Discord: #7574 Xarmat

commented

Edit:

  1. Use /ct json while holding the desired item
  2. open your "console" and copy the item with NBT into a Note++
  3. delete "[...]" around the item
  4. delete "§a NBT:"
  5. delete "[...]" around the long NBT
  6. place "/give @p 1 0" before the item

Example:
[tconstruct:broadsword]§a NBT: [{StatsOriginal:{AttackSpeedMultiplier:1.0f,MiningSpeed:2.0f,FreeModifiers:3,Durability:82,HarvestLevel:0,Attack:3.0f},Stats:{AttackSpeedMultiplier:1.0f,MiningSpeed:2.0f,FreeModifiers:3,Durability:82,HarvestLevel:0,Attack:3.0f},Special:{Categories:["weapon","tool"]},TinkerData:{Materials:["wood","wood","wood"],Modifiers:[]},Modifiers:[{identifier:"ecological",color:-7444965,level:1}],Traits:["ecological"]}]

/give @p tconstruct:broadsword 1 0 {StatsOriginal:{AttackSpeedMultiplier:1.0f,MiningSpeed:2.0f,FreeModifiers:3,Durability:82,HarvestLevel:0,Attack:3.0f},Stats:{AttackSpeedMultiplier:1.0f,MiningSpeed:2.0f,FreeModifiers:3,Durability:82,HarvestLevel:0,Attack:3.0f},Special:{Categories:["weapon","tool"]},TinkerData:{Materials:["wood","wood","wood"],Modifiers:[]},Modifiers:[{identifier:"ecological",color:-7444965,level:1}],Traits:["ecological"]}

commented

Tested with "/execute" with "kindlich":

Did not worked:
/execute @p ct give <conarm:chestplate>.withTag({StatsOriginal: {Toughness: 0.0 as float, FreeModifiers: 3, Durability: 64, Defense: 3.0 as float}, Stats: {Toughness: 0.0 as float, FreeModifiers: 3, Durability: 64, Defense: 3.0 as float}, TinkerData: {Materials: ["wood", "wood", "wood"], Modifiers: []}, Modifiers: [{identifier: "ecological_armor", color: -7444965, level: 1}], Traits: ["ecological_armor"]})
-[22:54:57] 'ct' is not a valid number

/execute @p ~ ~ ~ ct give <conarm:chestplate>...
-[22:59:56] Failed to execute 'ct give <conarm:chestplate>...

commented

I suggested the /execute command since I thought it would allow to execute as player, which it apparently does not.

1.12 Isn't the main focus any more so I would not hope for a change of this.
Also, all CraftTweaker commands require an OP level of 4, whereas command blocks only have an OP level of 2.
So even we added @p to that command, it would still not be executable.

Can you instead use the vanilla /give commands?
You can use /ct json to get the nbt for the item you are holding in the vanilla format.

commented

Tanks for the response,
I will use the /give command and make a workaround with more steps.
This topic can be closed then.

commented

A solution was found and it isn't exactly easy to change the permissions for a single sub command in our system.

commented

I found a way but its only tools i dont know if it works on other tools too
first u need craft tweaker then do a /ct hand
copy it
ex.
<tconstruct:lumberaxe>.withTag({StatsOriginal: {AttackSpeedMultiplier: 1.0 as float, MiningSpeed: 7.75 as float, FreeModifiers: 3, Durability: 1870, HarvestLevel: 4, Attack: 5.85 as float}, display: {NoRename: 1 as byte, Name: "InfiChopper"}, Stats: {AttackSpeedMultiplier: 1.0 as float, MiningSpeed: 999999.0 as float, FreeModifiers: 0, Durability: 999999, HarvestLevel: 4, Attack: 999999.0 as float}, Special: {Categories: ["aoe", "tool", "harvest"]}, TinkerData: {Materials: ["slime", "cobalt", "ardite", "ardite"], Modifiers: ["toolleveling", "infitool"]}, Modifiers: [{identifier: "slimey_green", color: -8206221, level: 1}, {identifier: "momentum", color: -14122284, level: 1}, {identifier: "stonebound", color: -3063280, level: 1}, {identifier: "petramor", color: -3063280, level: 1}, {identifier: "toolleveling", color: 16777215, level: 1, xp: 1, bonus_modifiers: 0}, {identifier: "infitool", color: 16777215, level: 1}], Traits: ["slimey_green", "momentum", "stonebound", "petramor", "toolleveling", "infitool"]})

then open notepad and paste that thing
and remove the as float, as short(if they have it) ,( ), < > and withTag
and finally remove some spaces
add the give command

give @p tconstruct:lumberaxe 1 0 {StatsOriginal:{AttackSpeedMultiplier:1.0,MiningSpeed:7.75,FreeModifiers:3,Durability:1870,HarvestLevel:4,Attack:5.85},display:{NoRename:1asbyte,Name:"InfiChopper"},Stats:{AttackSpeedMultiplier:1.0,MiningSpeed:999999.0,FreeModifiers:0,Durability:999999,HarvestLevel:4,Attack:999999.0},Special:{Categories:["aoe","tool","harvest"]},TinkerData:{Materials:["slime","cobalt","ardite","ardite"],Modifiers:["toolleveling","infitool"]},Modifiers:[{identifier:"slimey_green",color:-8206221,level:1},{identifier:"momentum",color:-14122284,level:1},{identifier:"stonebound",color:-3063280,level:1},{identifier:"petramor",color:-3063280,level:1},{identifier:"toolleveling",color:16777215,level:1,xp:1,bonus_modifiers:0},{identifier:"infitool",color:16777215,level:1}],Traits:["slimey_green","momentum","stonebound","petramor","toolleveling","infitool"]}
and youre done

commented

You can use /ct json to get the nbt for the item you are holding in the vanilla format.