Asweez Posted August 2, 2016 Posted August 2, 2016 I am making a server side mod in which I want to allow the player to open a chest (vanilla) and have several of the contents moving around. How do I make the contents update their location while the player has the chest GUI open? Quote Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
Asweez Posted August 2, 2016 Author Posted August 2, 2016 Where do I change the slots? Quote Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
Animefan8888 Posted August 2, 2016 Posted August 2, 2016 I would use // To do get the instance if the container that the player has open player.openContainer // Grab which block the player is looking at using MovingObjectPosition and the players look vectors. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
coolAlias Posted August 2, 2016 Posted August 2, 2016 If I recall correctly, the Container should have a reference to the Inventory, which should have a reference to the TileEntity in use, which should have a reference to the BlockPos. But if that's not the case, then yes, you'd have to resort to a raytrace to fetch the current block, but that's not totally reliable in this case - what if another player or mob interposes itself between the player and the open chest while they are perusing, for example? Container will still be open, but now the MovingObjectPosition will probably contain the mob. Or a player might place blocks between them. Rare, certainly, but it may happen. Quote http://i.imgur.com/NdrFdld.png[/img]
Animefan8888 Posted August 2, 2016 Posted August 2, 2016 It does, it had a get method for the private field that I wan't aware of. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.