Warp Marble (from the pages of the AD&D Tome of Magic)
The first command triggers the marble to create an extradimensional space large enough to contain a single large-sized creature. When this word is spoken, the closest creature to the marble is instantly transported to and imprisoned within this space. Similar to the seclusion spell, the inhabitant of this space can see and hear events in the "real world," but can do nothing to affect anything outside the prison. Spellcasting and use of psionics are impossible while within the prison. If the prison is already occupied, this first word of command will have no effect.
The second command word releases the occupant of the extradimensional space. The occupant is immediately returned to the "real world," appearing within three feet of the marble (wherever it might be). Note that this word of release can be spoken and will be effective from within the prison. Thus, the possessor of the marble can use it as a sanctuary to escape from harm.
The third word of command sets the marble as a trap. After this word is spoken, the first creature of large size or smaller to touch the marble is immediately imprisoned within the extradimensional space. If the first creature to touch the marble is larger than size L, the magic is not triggered; if a size L or smaller creature subsequently touches the item, the magic takes effect.
Once one creature has been imprisoned, other creatures can touch the marble with no adverse effects. A creature trapped in this method can be freed only through the use of the word of release from outside the marble.
A marble trapped in this manner can be thrown at another creature in an attempt to trap the creature. If an attack roll is successful, the target creature is allowed a saving throw versus spell. Success indicates that the creature suffers no effect. Failure indicates that the creature is trapped in the warp marble.
If a marble is taken into an extradimensional space (such as within a portable hole), if it is teleported, gated, or transported via dimensional folding or any analogous method, or if it is shifted to another plane of existence, any occupant of the extradimensional space is immediately expelled into the Astral plane.
* In your case the riddle soultion 'coffin' said in three different specific languages are the command words. I was incorrect regarding the HD limitation of the item- its limitation is the creatures size.