new @export hints for godot 4

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rockgg

back in 3.x versions of Godot there is this very useful way i often use which is

export(Array, Resource) var items = []

this essentially creates an array that could only store Resource.

I cannot seem to find a way to do this in Godot 4.0 anyone else has an idea to replicate this?

:bust_in_silhouette: Reply From: BoxyLlama

Godot 4 now supports Array Typing:
var some_array :Array[type]

So you can use this with the @export annotation, like so:
@export var items :Array[Resource] = []