A scarab gem is an extremely rare but very important item. When obtained, it can be used to tame a Tyrannosaurus or Allosaurus, or to make powerful tools. These tools also can be repaired on an Archeology Workbench with Relic Scraps, although this will clear all enchantments. It can also be crafted into an aquatic scarab gem, which is used to tame aquatic and semi-aquatic creatures.
Scarab gems are obtained by mining fossil blocks. They are extremely rare drops, with a drop rate of 0.01% (1⁄10,000)(If you want to increase your chances of getting the fossil block, knock it out with a pick with archeology enchantment). They can also be obtained as extremely rare loot in dungeon chests.
Once you have taken down the animal's hp enough and it goes into "sleep mode", simply right-click on the animal and it will recharge all your hp and so on.
Certain prehistoric creatures are virtually untamable unless presented with a magical scarab gem. Once the animal reaches adulthood (exact days listed on the creature's pages), the player must fight it and lower its health until the mob goes into a "weak" posture (which looks as if they are sleeping). The weakened creature then must be right-clicked with a scarab gem, which results in the loss of the gem and the complete healing of the now-tamed creature.
The scarab gem can be used to craft an aquatic scarab gem, which is used to tame aquatic and semi-aquatic creatures. These mobs are sarcosuchus in the 7.2 update and mosasaurus, liopleurodon and spinosaurus in the 7.3 update, since 8.0.0, Aquatic Scarab Gem is not required to tame liopleurodon.It requires a scarab and a piece of Dominican amber to craft.
Other than the aquatic scarab gem, the regular scarab gem has the potential to craft a few different items and blocks. The most useful things the scarab gem can craft are scarab tools and weapons. When a gold or diamond axe, hoe, pickaxe, shovel, or sword is combined with the gem, it creates a scarab axe, scarab hoe, scarab pickaxe, scarab shovel, or scarab sword, respectively.
Other than tools and weapons, the scarab gem is used to craft the time-machine. Though it can be crafted, the time-machine does not currently do anything. It will be used to transport players to a "Past" dimension in which dinosaurs spawn naturally, but this feature will likely not be added until a future update.