#Tools with extra attributes

22 messages · Page 1 of 1 (latest)

mighty girder
#

Hi so Im trying to make tools with extra attributes, the problem is when you craft them they lose their attack damage and attack speed value. Is there a way to fix that?

  Item.of('minecraft:wooden_shovel', '{AttributeModifiers:[{Amount:-1,AttributeName:"forge:reach_distance",Name:"forge:reach_distance",Slot:"mainhand",UUID:[I;-12403,20405,203449,-40810]}],Damage:0,Unbreakable:1}'), 
  [
    ' A ',
    ' B ', 
    ' B '
  ],
  {
    A: 'minecraft:flint',
    B: 'minecraft:stick'
  }
    )```
rapid ledgeBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

ancient furnaceBOT
#

You can write your code in a codeblock by typing it between the codeblock delimiters:
Note that these are backticks, not apostrophes

```js :arrow_left:

ServerEvents.recipes(event => {
event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

This example will look like this:

ServerEvents.recipes(event => {
  event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
vivid gull
#

try this

event.shaped(
  Item.of('minecraft:wooden_shovel', '{AttributeModifiers:[{Amount:-1,AttributeName:"forge:reach_distance",Name:"forge:reach_distance",Slot:"mainhand",Damage:0,Unbreakable:1}').strongNBT(), 
  ['A', 'B', 'B'], {
    A: 'flint',
    B: 'stick'
})
mighty girder
#

this recipe doesn't work at all

#

just adding .strongNBT() at the end doesn't seem to work either

#
[21:40:45] [ERROR] ! java.lang.NullPointerException: Cannot read field "f_128329_" because "p_128392_" is null```
vivid gull
#

what the

#

try weaknbt i guess?

event.shaped(
  Item.of('minecraft:wooden_shovel', '{AttributeModifiers:[{Amount:-1,AttributeName:"forge:reach_distance",Name:"forge:reach_distance",Slot:"mainhand",Damage:0,Unbreakable:1}').weakNBT(), 
  ['A', 'B', 'B'], {
    A: 'flint',
    B: 'stick'
})

ive never seen that error before

mighty girder
#

I think UUID is necessary for the recipe to work

pseudo estuary
#

with your original code, make sure you are on same instance of minecraft you are editing, and make sure you saved and reloaded

mighty girder
#

Thinking about it shovel was probably the wrong example

pseudo estuary
#

Oh I see, but that is how Minecraft works

#

When you have any NBT Attribute, it considers ONLY the nbt attributes

#

killing all base atributes

#

IF you want the base atributes, you need to add to the NBT also

#

OR you can use this in a diff approach, using .modifyResult

#

it will look cleaner btw

#

but will only work at shaped/shapeless recipes

#

@mighty girder are you ok with that?