Drinking while flying drones would be illegal under a bill in the state Senate, the latest effort by New Jersey lawmakers to regulate the flying robots.

A bill sponsored by state Sen. Paul Sarlo (D-Bergen), the chairman of the Senate budget committee, would be the first statewide drone law at a time when the unmanned aircraft are becoming more prevalent.

It would impose a range of restrictions on operating drones, barring residents from using the robots to harm humans or snatch up animals. Flying drones while drunk or on drugs would be made illegal. Violating the rules would be a disorderly persons offense, punishable with up to six months in prison, a fine of up to $1,000, or both.

“The use of drones has increased dramatically in recent years for a variety of purposes,” Sarlo said in a statement. “There are many benefits for commercial and recreational purposes but they can also pose threats to safety, security and privacy. The technology has outpaced regulations.”

The Senate and Budget and Appropriations Committee unanimously advanced the bill on Monday.

State lawmakers have tried before to regulate drones, namely to impose limits and rules on law enforcement agencies using the aircraft. One plan that twice passed the Legislature would have required police to get a warrant before using the aerial vehicles to conduct surveillance. Gov. Chris Christie twice pocket vetoed the legislation, meaning he let it expire without taking action, most recently in January 2016.

The latest bill, S-3370, deals with civilian, not law enforcement, use of drones. The measure would make it a fourth-degree crime to endanger the security of a correctional facility or interfere with first responders. That would be punishable by up to 18 months in prison, a $10,000 fine, or both.

Conducting surveillance of a correctional facility would be a third-degree crime, punishable by three to five years in prison, up to a $15,000 fine, or both. Using a drone to bypass a restraining order would be a violation, too.

Drones are rapidly growing in popularity and are easily available at retail stores. The Consumer Technology Association, a trade organization for the electronics industry, estimates that total drone sales in the United States will reach 3.4 million units in 2017.

“The Federal Aviation Administration regulates drones used near airports or that could interfere with airspace routes and the U.S. Department of Transportation regulates the use of commercial drones, but there are no statewide rules in place to cover their more expansive use in communities,” Sarlo said. “There are more unmanned drones in the country than piloted aircraft.”

Some New Jersey towns already have drone laws on the books, according to Senate Democrats. Provisions of the Senate bill would preempt any law, ordinance, resolution or regulation adopted by local governing bodies.

A companion bill has not been introduced in the Assembly, and even if it were, and it passed, there is no indication Christie would sign it before leaving office Jan. 16. Without the governor’s signature, the bill would expire and would have to be reintroduced at the beginning of the new legislative session in January, when Governor-elect Phil Murphy is set to take office.