default:netherite_anvil:
material: nether_brick
custom-model-data: 3001
data:
item-name: "[URL='http://item.net']item.net[/URL]herite_anvil>"
model:
type: "minecraft:model"
path: "minecraft:item/custom/netherite_anvil"
generation:
parent: "minecraft:block/custom/netherite_anvil"
behavior:
type: block_item
block:
loot:
template: "default:loot_table/basic"
arguments:
item: default:netherite_anvil
behavior:
type: falling_block
hurt-amount: 4
max-hurt: 80
events:
- on: right_click
functions:
- type: run
functions:
- type: open_window
gui-type: anvil
- type: cancel_event
conditions:
- type: equals
value1: "<arg:player.is_sneaking>"
value2: "false"
#conditions: # 另外一种格式
# - type: expression
# expression: "!<arg:player.is_sneaking>"