You can only use physics joints to connect physics entities, i.e. entities with PhysicsBodyComponent. To make one entity follow another entity even if they are not both physics entities, use:
swordEntity.align(swordPin, to: attackPin)
You need to make this call on every update because it doesn't create a joint maintained by physics, it just translates and rotates swordEntity to make the pins aligned.
Regarding the attackPin, simply create it from the entity and the name of an existing joint/pin:
let jointName = "root/pelvis/spine_01/..."
let attackPin = EntityGeometricPin(entity: attackEntity, pinName: jointName)