Help Understanding Plugin Limitations

Discussion in 'Spigot Discussion' started by FlowerOLife, Nov 25, 2019.

  1. As the title suggests, I'm simply trying to understand a plugin's limitations. I have found a few articles that very lightly cover the subject, but being very new to Java, there is only so much I could gather from said articles.

    I am trying to learn to write plugins, but before I get too far, I would really like to understand fully the limitations of a plugin. If anyone knows of any good articles which cover this subject in depth, I would really appreciate you sharing a link with me.

    Also, if anyone has any good suggestions for a very basic plugin idea, I'm all ears. I need something very simple to practice with aside from "HelloWorld".
     
  2. You're not really that limited actually
    When it comes to limitations
    Is it purely client side? If yes, you can't do anything with it.
    Want to do something on key press? Can't do that either
     
  3. To clarify my reasons for asking this question, I would really like to create some new items/tools, blocks, and change ore generation on newly generated worlds. From all I have read, creating new blocks is client-side modding, and I am trying to avoid that, and otherwise, I can't really find much on creating new items without changing another block or item id, which I would also like to avoid.

    I understand some of which I'm trying to do is not basic, but it is something to work towards, if even possible...
     
  4. It's possible since 1.14 (and even before but it was really hard) ... but I don't know how you can do it...
    Maybe you can ask for the source code here : https://www.spigotmc.org/resources/...h-custom-texture-3d-model-without-mods.22783/
    Otherwise, the source code for something like that can be found here for free : https://www.spigotmc.org/resources/oraxen.72448/
     
  5. You cannot create a completely new item/block, however with a plugin you can modify existing items to act like a new one. As for ore generation, that is completely possible.
     
    • Agree Agree x 1
  6. I had seen the first of the two links, and it said it was only compatible up to 1.13.2. Otherwise, I couldn't find a plugin that did this for 1.14. I think I will just use the Oraxen plugin and see how that goes. That seems like it would be the more efficient way to go for me. Thank you. :)

    Your response is also very appreciated. I have seen how people replace things like armor stands, but it seemed a little strange to generate a new block that way IMO. Would you happen to know of any resources that might show how to create custom ore generation? I believe what I'm trying to achieve may be a bit complex, but I don't know exactly how it would work just yet. I had an idea of having natural caves spawn as ore veins rather than the traditional random distribution of ore. I don't know if that would tie in with ore generation, or if it would be a matter of manipulating the cave generation, but I was hoping to figure that part out.
     
  7. Some Limitations
    • You can't add new textures to the game. There are texture packs and some hacky workarounds, but at the end of the day you're limited by the vanilla client textures.
    • Client-assumed behaviour. What do I mean by this? Let's suppose you were trying to make an animation by continuously teleporting a dropped item to a specific floating location. If the client has a slow connection, the item will fall until the connection keeps up. When players are in Survival mode, even with WorldGuard or other protection plugins, it will still seem to them like they can "break" a block, only for it to be restored a few milliseconds later (it's mostly apparent for slow connections).
    • Hard-coded basic functionality. For example, you can't hit a player with your sword from over ~4-5 blocks away. No matter what plugins do, this won't change. It's possible to make all sorts of ranged weapons, but no plugin can make melee combat occur 20 blocks away.
    Think of how the server sends data to the client. It doesn't tell the client everything about Minecraft since the client already knows most things. It tells clients what they need to know. For example, when the server sends a title to a client, the client gets a packet saying "you got this title". But you cannot change the size of the title with plugins – there's no way to say "you got this title, but it's twice as large." The functionality simply doesn't exist in the server-client interaction process.

    Do you know how BossBar plugins work? They send messages to players in the bossbar. Prior to 1.9, there was no way to tell a client to simply display text in the bossbar. Plugins told clients there was an invisible enderdragon or wither named according to the message the plugin wanted to send. Accordingly, the clients displayed the bossbars because they were told there was an enderdragon/wither nearby!
     
  8. I think I get what you are saying, and this is most helpful in terms of clarity btw. The one thing I'm having a hard time understanding is how the plugins suggested by uiytt are able to add custom items without mods. Do these not require some kind of added texture packs? And if so, how does the client know how to see the added items without client-side mods? Only asking for the sake of a deeper understanding of how the server is communicating with the client.
     
  9. Honestly I don't know how client-side custom items are made since that would require some weird way of creating new textures. Nor do I know if they're even possible in an abstract sense. AFAIK, any kind of custom item somehow relies on existing Minecraft features/textures.
     
  10. I see. Well thank you for your detailed explanation. :)
     
  11. I'm gonna play devil's advocate here.

    Technically you can.
    1. Listen when player left clicks
    2. Check whats the first entity 20 blocks in the same line of sight as the player
    3. ???
    4. profit
     
  12. You didn't read my message carefully enough.
    It's possible to make something which appears to be a melee weapon which is really just a ranged device, in the fashion you mentioned. With such an approach, however, the damage cause for simulated long-range melee attacks would not be DamageCause#MELEE, so you would quickly run into compatibility issues.
     
  13. So with 1.14 you can make a resource pack that has custom models for entities and use the customModelData tag. You could do this for a bow and have many different bow types but it will still act like a bow. A plugin is able to modify the item meta and that's where the custom model tag comes into play. The server I work for we have custom models for many things from chairs to tables to custom hats.
     
  14. False this can be achieved by calling the EntityDamageByEntityEvent and
    setting the damage cause to DamageCause.ENTITY_ATTACK
    then if the event is not cancelled damage the player manually

    The majority of limitations to plugins are mostly client side data interpretation
    Basically which data is taken from the server and which data is hard coded client side
    or processed client side.

    An example of this is entity rendering and animation data
    most of this is handled client side with hard coded data or localized resource

    We can create sidebars but the code must comply to how a client interprets the data
    sent by the server like team name suffix and prefix
     
    • Like Like x 1
  15. the customModelData class field is mostly available with ItemStacks no custom model data is available yet for LivingEntities
    (as of time of post) One way to achieve this is by installing the Optifine mod or any other mods that deals with entity modeling
     
  16. As I've stated you would cause loads of plugin compatibility issues if you did that, especially with anticheats.
     
  17. No where in your previous post did you mention about plugin compatibility.
    Main issue here is can it be done? Yes it can.
    The main topic here is what is the extent of functionality a server plugin can achieve.

    Now for plugin compatibility issues which is out of the scope of this thread.
    I will just give some solutions
    - plugin integration
    - plugin API's example of this is SPARTAN and AAC's API's
    - adding compatibility support for anti cheats or any other plugin that may conflict with your plugin
    - coding your plugin to respect any game mechanics imposed by another plugin like for example
    listener priority or code checks for cancelled events
    or simply creating your own custom event which most anti cheat does not flag

    For all of that said it all boils down to the question can a plugin achieve that functionality?
    Yes a plugin can do that.

    Now can a plugin detect accurately if a client is modded or not?
    at the time of this post unfortunately no.

    Can a server plugin dynamically add individual textures to client side texture pack?
    at the time of this post unfortunately no.
     
    • Like Like x 1
  18. A plugin can only build upon already existing features, a mod on the other hand can create new items and mechanics. It would be possible to add a 'new' block by creating a plugin but you will need to sacrifice a block or item for it, and this is not an option in most of the cases. As for plugin ideas that the op asked for: you could try to create a sethome plugin, a particle trail plugin (try adding particles to arrows too or create nice paterns) or try changing the way mobs behave. I hope this will help you and keep you bussy with some fun little projects.
     
    • Like Like x 1
    • Like Like x 1
  19. I gotta appreciate the conversations which have taken place in this thread. The differences in understanding the language is interesting, but also really powerful. I'm glad to see these differences because it is helping me to understand a few things already, some information which I was not expecting, but valid to the thread topic nonetheless.

    So what I can gather from everyone's responses is that a plugin can ultimately achieve anything which is server-side interpretation, but cannot change the way a client views the hard-coded information for Vanilla Minecraft (which I partially had an understanding of already), but what I still have a hard time understanding is, such as in the topic being discussed regarding ranged melee weapons, is how does the client interpret the information? Doesn't a weapon's behaviors and event handling fall into client-side? Or as another example, using a plugin to alter the meta of another block, how does the client interpret these changes without mods?

    I really just want to gain a base understanding of how the server and client communicate, in hopes that it might lead me to a greater understanding of a plugin's limitations.