addPersistentDataIf

fun addPersistentDataIf(key: NamespacedKey, value: String, condition: Boolean = false): ItemBuilder(source)

Adds persistent data to the item if the specified condition is true.

Return

the ItemBuilder instance

Parameters

key

the namespaced key of the data

value

the value of the data as a string

condition

the condition that must be met to add the data (default: false)