Is there a Skyrim command to check if a player knows a spell?

Is there a Skyrim command to check if a player knows a spell? - Smiling woman with chess looking at camera

I am thinking about making a mod for Skyrim. One thing that this mod hinges on is checking if a player already knows a spell. I have been looking high and low for a script command, but have yet to find one.

Is there a script command somewhere that can check this? For example, something that would allow this:

If player."HasSpell" spellid {
  player.RemoveSpell spellid
} else {
  player.AddSpell spellid
}

...or something to that effect. If there isn't a command, can anyone think of alternatives/workarounds to accomplishing this?






Pictures about "Is there a Skyrim command to check if a player knows a spell?"

Is there a Skyrim command to check if a player knows a spell? - Man in Black and White Shirt and Black Pants Standing on Field
Is there a Skyrim command to check if a player knows a spell? - Man in Black and White Ice Hockey Jersey Playing Hockey
Is there a Skyrim command to check if a player knows a spell? - Black and Red Helmet on White and Red Textile



How do you toggle detection in Skyrim?

To fix, use TC on the Dragonborn to turn off their actions. This will toggle Combat Artificial Intelligence (Characters may turn hostile but will not attack the Dragonborn.) You can toggle Collision using this command....Player Commands.CommandEffectplayer.drop <ItemID> <#>This will drop the item.34 more rows•Nov 19, 2011

How do I use the PRID command in Skyrim?

Instructions
  • To place a new copy of an NPC at your current location, type the following in the console: player.placeatme <BaseID> <#>
  • To move to an NPC, type the following in the console: player.moveto <refID>
  • To move an NPC to you, type the following in the console: Prid <refID>
  • Followed by: moveto player.


  • What are the console commands for Skyrim?

    All Skyrim Console Commands
    • tgm - Toggles God mode (Invincibility, infinite carry weight)
    • tcl - Toggles No-clip mode (Fly, walk through walls)
    • coc "Location" - Teleports you to that location, An all item room is coc QASmoke.
    • psb - Give all spells to player.
    • player.advlevel - Force a Level Up ( No perk points added)


    What are console commands?

    Console Commands are a debugging tool available to PC players, adding a wide range of functionality to the game. On American English keyboards, the tilde key (~) will toggle the console screen, but on British English keyboards, that key is the grave key ( ` ).



    Skyrim Console Commands (Full List) and Usefull Ones [PC Only]




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Victoria Borodinova, Mathias Reding, Ron Lach, Ron Lach