Shopkeepers

Shopkeepers

2M Downloads

[Feature Request] Shopkeeper speed and noAI options

LogGits opened this issue ยท 6 comments

commented

Can you add an option to set the shopkeepers speed to 0 and and option for noAI. This would keep shopkeepers facing a specific position and stop them from being pushable.

commented

There is already an ticket about unpushable mobs: #370
Unfortunely, there is no good way inside bukkit to make mobs unpushable yet. And the NoAI tag also disables the look-at-nearby-players and the float-on-water behavior of mobs, which I do not want to remove.
For some (unsupported) mobs it already uses the NoAI tag, because they wouldn't work properly at all without it (see https://github.com/Shopkeepers/Shopkeepers/blob/master/src/main/java/com/nisovin/shopkeepers/shopobjects/living/LivingEntityShop.java#L336).

What I could do, is maybe (temporarily, until I find a proper way to make mobs unpushable) add a global setting, to always set the NoAI tag for all mobs, in case you really prefer that instead of the current behaviour. However, shops currently don't store their facing rotation at all (only their x,y,z coordinates). So I would also have to change that as well then.

commented

The mobs only move due to being pushable or due to water flow (they don't move by themselves). The idea is to add a config option to set all mobs to NoAI. This config option is easier to add and doesn't require additional user interaction compared to a new command or editor option, and would probably only be needed until I find a proper way to make mobs unpushable.
The shop's yaw (and maybe pitch as well) could be setup on shop construction to face the player creating the shop. It would not be modifiable after creation.

commented

So on of the reasons i have to use citizens is because the shopkeepers move. It would be very convenient if you could add an option to spawn a noAI mob. Additionally, noAI mobs cant get pushed around.

This would be very convenient of a feature, granted, you would need to store yaw and pitch values aswell. Dont use noAI for all mobs as i am assuming some people want the ai factor. Maybe add a new attribute or command. Anyhow, love the plugin, keep up the great work!

commented

I have looked into this and decided to not add this setting/option:

  • Simply setting all mobs to into NoAI mode will also cause them to no longer be affected by gravity (shopkeepers are currently spawned above the ground and expected to then fall to the gound), they loose their look-at-players-behavior and they no longer float on water.
  • Even if I started storing pitch+yaw for newly created shopkeepers now, I cannot handle already existing shopkeepers, since I do not know their supposed facing direction. So I would have to also manually re-implement the look-at-nearby-players behavior.
  • I don't want to add this as a per-shopkeeper option (easiest would be via command): In my view this is something way too specific to be offered to the users as per-shopkeeper/command option. I assess that the resulting increase in plugin complexity (from the user perspective) and its implementation effort to not be worth it / doesn't fit the scope of this plugin (since this is not a general-purpose npc plugin, like Citizens for example is).
  • The actual underlying issue are the pushable mobs. I would much rather find a general way to solve this instead. I have therefore looked into the various available options, but each has its flaws as of right now. I updated the ticket about the available options I have looked into so far, see here: #370

By the way, if you have any further ideas how to solve the pushable-mobs problem in a general way, I am open for all kinds of suggestions/ideas and will gladly look into them.

For the time being you will have to stick with the citizens shopkeepers if unpushable shopkeepers are that important to you.

I am closing this as 'duplicate' since the underlying issue which needs to be solved are the unpushable mobs, for which the linked ticket is available.

commented

I have looked into this again over the last weeks and was able to come to a solution which I find sufficient: Check out v2.0.0-beta: It uses the NoAI tag for mobs now, but still preserves the important parts of their AI by performing/triggering them manually within the plugin. Using the NoAI tag also fixes a few other issues.

commented

i think this is my actual problem, my traders somply dont look at players, seems like they have the AI dissabled by default and i cant eaven move their heads to "simulate" they are looking at you...

reloading the server and the pluggind dont do any change :(