<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnPlayerConsumableFinalizeRequested</id>
	<title>OnPlayerConsumableFinalizeRequested - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=OnPlayerConsumableFinalizeRequested"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerConsumableFinalizeRequested&amp;action=history"/>
	<updated>2026-09-19T08:19:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=OnPlayerConsumableFinalizeRequested&amp;diff=783&amp;oldid=prev</id>
		<title>QCherry: Document stable consumable lifecycle callbacks for 0.1.3</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnPlayerConsumableFinalizeRequested&amp;diff=783&amp;oldid=prev"/>
		<updated>2026-09-08T14:06:26Z</updated>

		<summary type="html">&lt;p&gt;Document stable consumable lifecycle callbacks for 0.1.3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= onPlayerConsumableFinalizeRequested =&lt;br /&gt;
&amp;lt;div style=&amp;quot;background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; font-weight:bold; letter-spacing:0.04em;&amp;quot;&amp;gt;AVAILABLE FROM UPDATE 0.1.3&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; margin-top:0.25rem;&amp;quot;&amp;gt;This event is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Triggered after the inventory removal is durable and the server has applied the authoritative instant effect, requesting persistence of the final settlement snapshot.&lt;br /&gt;
&lt;br /&gt;
== Availability ==&lt;br /&gt;
This event is available in &amp;#039;&amp;#039;&amp;#039;server-side&amp;#039;&amp;#039;&amp;#039; scripts.&lt;br /&gt;
&lt;br /&gt;
== Callback signature ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onPlayerConsumableFinalizeRequested(playerId, itemKey, inventoryItemId, sequence, generation, commitKey, quantityRemaining, health, maxHealth, mana, maxMana, strength, dexterity, alcohol, swampweed, appliedHealth, appliedMana, periodicTicks, periodicHealthPerTick, periodicManaPerTick)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The player using the consumable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;itemKey&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The stable native inventory key of the consumable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;inventoryItemId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The native numeric consumable ID.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sequence&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The positive client request sequence.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;generation&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The positive settlement generation; a newer snapshot uses a higher value.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;commitKey&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || The opaque durable-operation key supplied by the commit request.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;quantityRemaining&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The current authoritative inventory quantity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;health&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical health in the settlement snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;maxHealth&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical maximum health in the settlement snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;mana&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical mana in the settlement snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;maxMana&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical maximum mana in the settlement snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;strength&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical strength in the settlement snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;dexterity&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical dexterity in the settlement snapshot.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;alcohol&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical alcohol progression value.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;swampweed&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Canonical swampweed progression value.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;appliedHealth&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Instant health change applied by this operation.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;appliedMana&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Instant mana change applied by this operation.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;periodicTicks&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The number of periodic ticks authored for the item.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;periodicHealthPerTick&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Authored health change per periodic tick.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;periodicManaPerTick&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Authored mana change per periodic tick.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Handle the event:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerConsumableFinalizeRequested&amp;quot;, root, function(playerId, itemKey, inventoryItemId, sequence, generation, commitKey, quantityRemaining, health, maxHealth, mana, maxMana, strength, dexterity, alcohol, swampweed, appliedHealth, appliedMana, periodicTicks, periodicHealthPerTick, periodicManaPerTick)&lt;br /&gt;
    outputDebugString(&amp;quot;Consumable finalize requested: &amp;quot; .. commitKey .. &amp;quot; generation=&amp;quot; .. generation)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* This advanced durability-lifecycle callback is part of the stable server-side Lua contract beginning with update 0.1.3.&lt;br /&gt;
* The bundled &amp;lt;code&amp;gt;gothic_rp&amp;lt;/code&amp;gt; resource owns persistence and is the only resource authorized to acknowledge this request with &amp;lt;code&amp;gt;completePlayerConsumableFinalize&amp;lt;/code&amp;gt;. Other resources must treat it as read-only.&lt;br /&gt;
* The same generation can be delivered again after a persistence failure. A concurrent authoritative progression change can produce a newer generation that supersedes an older snapshot.&lt;br /&gt;
* A Lua return value does not complete the operation. Do not reapply the item effect or overwrite progression from an older generation.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Events]]&lt;br /&gt;
[[Category:Server Events]]&lt;br /&gt;
[[Category:Magic Events]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>