Behaviour in mobs for java version

I have the Java version of Minecraft for my son. We noticed that you can create behaviours for mobs in the windows 10 version but not the Java version. Can this be done in code? Or is this a windows only thing?