I struggled a bit to find the solution, but here it is:
What you want to do is access the AnimationPlayer's Animations. Then you want to access the respective Animations' tracks and alter the INTERPOLATION_MODE property of each track. You can do this during runtime or, better yet, create a script that works from within the editor, without running the game. I am going to explain the latter.
1) Go to the Script workspace (near the 3D workspace on the top)
2) Create a new script resource (File--> New Script)
3) Write the following code in the newly created script:
tool # makes script run from within the editor
extends EditorScript # gives you access to editor functions
func _run(): # this is the main function
var selection = get_editor_interface().get_selection() * the selected node. In your case, select the AnimationPlayer
selection = selection.get_selected_nodes() # get the actual AnimationPlayer node
if selection.size()!=1 and not selection is AnimationPlayer: # if the wrong node is selected, do nothing
interpolation_change(selection) # run the funstion in question
var anim_track_1 = selection.get_animation("default") # get the Animation that you are interested in (change "default" to your Animation's name)
var count = anim_track_1.get_track_count() # get number of tracks (bones in your case)
for i in count:
anim_track_1.track_set_interpolation_type(i, 1) # change interpolation mode for every track
4) Go to File-->Run. You should see the Interpolation mode change from linear to nearest.
How it works:
This script iterates through the tracks of your Animation and it changes the INTERPOLATION_MODE for each of them to 0 (nearest).
Check the doc fro more info here:
For more info on EditorScript, namely scripts that run from the editor, check this out:
If this helps you, please mark the answer as best.