[SPIGOT-3368] Unable to set anvil's repair/enchant cost window property Created: 23/Jun/17  Updated: 23/Jun/17  Resolved: 23/Jun/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: BillyGalbreath Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None


 Description   

1.12 I am unable to set an anvil's repair cost window property. The API method returns true, but the value is never sent to the client.

@EventHandler
public void onPrepareAnvil(PrepareAnvilEvent event) {
    boolean result = event.getView().setProperty(InventoryView.Property.REPAIR_COST, 50);
    System.out.print("Result: " + result);
}

This worked beautifully in 1.11.2, and I've checked the server implementation against the wiki.vg protocol and nothing seems to have changed there.



 Comments   
Comment by md_5 [ 23/Jun/17 ]

This did not work in 1.11.2 by the way.

Comment by BillyGalbreath [ 23/Jun/17 ]

Found a workaround solution:

@EventHandler
public void onPrepareAnvil(PrepareAnvilEvent event) {
    event.getInventory().setRepairCost(50);
}

This works, but the original issue about the property api stands.

Generated at Sat Dec 13 15:25:32 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.