Essentials Docs Wiki
For regular visible items lying around in maps, see Item balls.

This page describes how the Itemfinder item works in Essentials.

The Itemfinder

The Itemfinder, also known as the Dowsing Machine, is a Key Item that can be used to find hidden items in maps. It has a range of 7 tiles in the east/west directions and 5 tiles in the north/south directions, which covers all the whole tiles visible on-screen at the default screen size (it doesn't cover the half-tiles visible at the edges of the screen).

When the Itemfinder detects a hidden item, it will turn the player to face towards it. If the player is standing on it, the player will spin around instead.

Hidden items

A hidden item is an event containing the phrase "HiddenItem" (this text is not case-sensitive; note the lack of a space between the two words). The event's name may contain other text as well.

You can name an empty event "HiddenItem:POTION" (or some other item name), which will make the Compiler rewrite the event and turn it into a hidden item event with the appropriate pages and commands.

For a hidden item event to be detectable by the Itemfinder, its Self Switch A must be OFF. Picking the item up turns its Self Switch A ON, meaning it should no longer be detectable because the item is no longer there.

A hidden item event can technically do anything (because the only requirements are having "HiddenItem" in the event name and for its Self Switch A to be OFF). It does not have to be an item ball; however, it usually will be.

Itemfinder's code

The code for the Itemfinder's effect is in an ItemHandlers::UseInField proc in the script section Item_Effects. It makes use of def pbClosestHiddenItem which is in the script section Item_Utilities.