I want it to at least be able to play minecraft.
Is 400 dollars a good amount to build a gaming pc?
Bare minimum.
The secret about PC gaming is that most builders go OVERKILL on their builds and neglect to take into account software and peripherals into their budgets.
The real minimum is a case with a fan, a motherboard with a PCI x16 slot, compatible dual core CPU, 4GB RAM, 100GB HDD, 300W (recommend 500W for upgrades) and a GT 640 or equivalent and up. The biggest difference you'll notice in games comes from the GPU, so if you plan to upgrade later, avoid getting a weak PSU. Don't forget the cost of the OS (XP or newer), and the mouse and keyboard.
You should be able secure these for $400 if you spend the time searching, but most likely you'll end up spending around $500 and up anyway, so prepare!
Hope this helps, comment if you need more!
You could be able to get a pretty cheap desktop computer for around $10 if you look, then switch out the parts that need upgrades, like the RAM, the hard drive, graphics card, etc. The minimum you'll need is about 2GB ram or greater with at least AMD or better graphics card. Hard drive can be any size, though at least 1GB or greater, since I'm going to assume you'll want to get mods for added content or utility features.