<?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=OnWorldItemDrop</id>
	<title>OnWorldItemDrop - 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=OnWorldItemDrop"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnWorldItemDrop&amp;action=history"/>
	<updated>2026-09-19T06:26:15Z</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=OnWorldItemDrop&amp;diff=736&amp;oldid=prev</id>
		<title>QCherry: Document Lua events available or improved from G1R:MP 0.1.2</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=OnWorldItemDrop&amp;diff=736&amp;oldid=prev"/>
		<updated>2026-09-03T18:41:22Z</updated>

		<summary type="html">&lt;p&gt;Document Lua events available or improved from G1R:MP 0.1.2&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= onWorldItemDrop =&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.2&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.2 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 for public server resources after a player-initiated world-item drop is durably committed and published.&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;
onWorldItemDrop(objectId, playerId, itemKey, quantity, serverTimeMs)&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;objectId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The positive server-assigned 64-bit ID of the published dropped item.&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 whose inventory supplied the dropped item.&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 inventory and world-item definition key.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;quantity&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || The committed quantity removed from inventory and published in the world.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;serverTimeMs&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Server timestamp recorded when the accepted drop intent created the quarantined item.&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;onWorldItemDrop&amp;quot;, root, function(objectId, playerId, itemKey, quantity, serverTimeMs)&lt;br /&gt;
    outputDebugString(&amp;quot;Player &amp;quot; .. playerId .. &amp;quot; dropped &amp;quot; .. quantity .. &amp;quot;x &amp;quot; .. itemKey)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* The runtime first quarantines the new object and removes the quantity from the authoritative inventory cache. The bundled GothicRP resource persists that change before confirming the transaction.&lt;br /&gt;
* Only a successful durable confirmation publishes the item and emits this callback to public resources. A failed or rolled-back drop publishes no public &amp;lt;code&amp;gt;onWorldItemDrop&amp;lt;/code&amp;gt; event and restores the authoritative inventory state when the session is still connected.&lt;br /&gt;
* The active item is broadcast reliably before public callbacks run and is then included in late-join state. This is an observation event: do not remove the inventory quantity a second time.&lt;br /&gt;
* Player-initiated drops emit this event instead of [[onWorldItemSpawn]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Events]]&lt;br /&gt;
[[Category:Server Events]]&lt;br /&gt;
[[Category:World Events]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>