Probably your best shot of detecting collisions is to schedule a 1-Tick task where you check if the distance between stand and player is lower than a certain threshold
In player.getWorld().spawnEntity(player.getLocation() Can i do so it spawn it like 1 block backward the player and not in the player?
If you want to spawn the armor stand 1 block backward the player, you can do the following. Code (Text): Location location = player.getLocation(); Vector direction = location.getDirection(); location.add(-direction.getX(), 0, -direction.getZ()); location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND); For the collision detection, you can use events.
armorstand.setHelmet do not work with Code (Text): Location location = player.getLocation(); Vector direction = location.getDirection(); location.add(-direction.getX(), 0, -direction.getZ()); location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND);
Try replacing Code (Java): location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND); with Code (Java): location.getWorld().spawnEntity(location, ArmorStand.class);