Jump to content

Recommended Posts

Posted

Hi

 

I am newbie to minecraft and python and I am trying to play with python api to minecraft looking at https://www.nostarch.com/programwithminecraft .

I use spigot 1.9.4 comming from https://sourceforge.net/projects/python-with-minecraft-windows/

 

I see how to build blocks

mc = Minecraft.create()

mc.setBlock(x, y, z, blockType)

but I cannot find how to destroy blocks.

 

  • Is destroying blocks, or attacking mobs with sword possible with python api ?
  • How can I call left mouse button with minecraft python api ?
  • Is it possible to simulate mouse buttons with python api at all ?

  • BTW, can I recognize mobs, zombie or animals with python api ? Can I attack mobs, zombie or animals with python api?

 

Regards

 

 

 

 

 

Posted

I'm sorry to say this, but I don't think anyone on this forum has used that before, so nobody will be able to help you on this forum. Also, this isn't anything Forge related, so we can't help either.

 

If you really want to mod Minecraft, preferably using Forge, you should probably learn Java. It's the language Minecraft is written in, and will give you the best modding experience for Minecraft. Some might say another language is better for Minecraft, but for starters, Java will be the easiest.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Thank you lasgerrits.

 

[*]Does Forge with java allow to write AI for a player - I would like to write algorithms simulating (controlling and automating) a player.

[*]Are there api for eg. left mouse button, right mouse button, changing items in inventory, checking which items I have in inventory, checking if there is mob nearby, checking type of mob, checking types of surrounding blocks ?

[*]Does forge apply only to single player, or also to server mode ?

 

 

 

Regards

 

Posted

Forge is an API/ML that provides modders with being able to access the Minecraft code and extend upon it.. Yes you can do the things mentioned, however its pretty complicated and I would start with the basics, especially if your new to Java and Forge all together. A great tutorial you could start with is here: https://shadowfacts.net/tutorials/forge-modding-1102/

Relatively new to modding.

Currently developing:

https://github.com/LambdaXV/DynamicGenerators

Posted
  On 1/8/2017 at 9:22 AM, superbilder said:

Does forge apply only to single player, or also to server mode ?

 

This is a question asked from such appalling ignorance I wonder if you've even played any mods.

Of course it works with both!

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • 2 weeks later...
Posted

Draco18s you are very shrewd :o, you unraveled me completely. I haven't played any mods, whats more I dare to say I do not intend (unless I write my own).

[*]

Can client mod play with original server unrecognized by server or it's impossible ?

[*]Does client AI mod playing server mode see whole world, or only this what human player can see? Eg can AI mod see several levels underground (unlike human), or not ?

[*]More generally, would such AI (only on client side) vs human be fair (had the same or less information/possibilities) or not (had more information/possibilities)

[*]How AI can get know of appearing mobs, are there any events sent when mob appears in some distance, or AI would have to check every qube in area of interest

[*]Would it be possible to attack mobs with such AI ?

 

 

Sorry for asking ignorant questions, but I wouldn't like to dive into forge to find out, that it's not a right tool for my purpose.

I have a good knowledge of java. I would like to write simple AI supporting player in some tasks, eg auto mining of materials and putting them into chest - good to dig diamonds for several hours. Why would it be complicated to write such a simple supporting AI ? Is it a problem of forge API not supporting such purpose?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello , when I try to launch the forge installer it just crash with a message for 0,5 secondes. I'm using java 17 to launch it. Here's the link of the error :https://cdn.corenexis.com/view/?img=d/ma24/qs7u4U.jpg  
    • You will find the crash-report or log in your minecraft directory (crash-report or logs folder)
    • Use a modpack which is using these 2 mods as working base:   https://www.curseforge.com/minecraft/modpacks/life-in-the-village-3
    • inicie un mundo donde instale Croptopia y Farmer's Delight, entonces instale el addon Croptopia Delight pero no funciona. es la version 1.18.2
    • Hello all. I'm currently grappling with the updateShape method in a custom class extending Block.  My code currently looks like this: The conditionals in CheckState are there to switch blockstate properties, which is working fine, as it functions correctly every time in getStateForPlacement.  The problem I'm running into is that when I update a state, the blocks seem to call CheckState with the position of the block which was changed updated last.  If I build a wall I can see the same change propagate across. My question thus is this: is updateShape sending its return to the neighbouring block?  Is each block not independently executing the updateShape method, thus inserting its own current position?  The first statement appears to be true, and the second false (each block is not independently executing the method). I have tried to fix this by saving the block's own position to a variable myPos at inception, and then feeding this in as CheckState(myPos) but this causes a worse outcome, where all blocks take the update of the first modified block, rather than just their neighbour.  This raises more questions than it answers, obviously: how is a different instance's variable propagating here?  I also tried changing it so that CheckState did not take a BlockPos, but had myPos built into the body - same problem. I have previously looked at neighbourUpdate and onNeighbourUpdate, but could not find a way to get this to work at all.  One post on here about updatePostPlacement and other methods has proven itself long superceded.  All other sources on the net seem to be out of date. Many thanks in advance for any help you might offer me, it's been several days now of trying to get this work and several weeks of generally trying to get round this roadblock.  - Sandermall
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.