I need help with a new gui system im working on

how would i spawn a entity with a spawn egg with that entity having tags also replacing that entity with a barrel
Continue to help post