Many servers utilize plugins and custom resource packs to transform standard items into tools with unique abilities or ranged attributes.
If you want the visual aesthetic of guns while playing offline, you can import a custom texture pack. Eaglercraft Gun Mod
The Ultimate Guide to the Eaglercraft Gun Mod: How to Add Firearms to Your Browser-Based Minecraft Many servers utilize plugins and custom resource packs