#help-development

1 messages ยท Page 4 of 1

ornate patio
#

wait what

tender shard
#

so just do sth like this

File file = new File(getDataFolder(), "surnames.txt");
if(!file.exists()) {
  saveResource("surnames.txt", false);
}
ashen quest
#

its the package the main is in

chrome beacon
#

You have the wrong package in the plugin.yml

ornate patio
#

it looks like saveResource should automatically create a file tho

tender shard
#

it does

ashen quest
tender shard
#

but if you set "replace" to false, and the file already exists, then it prints an error

#

and you don't want that

ashen quest
chrome beacon
tender shard
#

just use what I sent, that should definitely work

ornate patio
#

thanks

tender shard
#

np!

ashen quest
#
main: com.annihilation.core.main.AnnihilationMain

Still spigot says

[22:40:27 ERROR]: Could not load 'plugins\AnnihilationCore.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `com.annihilation.core.main.AnnihilationMain'
tender shard
#

open your .jar with winrar or similar, see if it actually contains the class at the given locationn

#

also how tf did you manage to write so many classes without running your plugin at least once

gleaming grove
#
what do you think of this implementation

0. Load config and check if autoupadates are allowed 
1. Check latest  release version at Github
2. If version is higher then current then download it
3. Remove current plugin jar file
4. Put dowloaded plugin to plugins dictionary
5. Schedule Bukkit task after to run 5sec and load downloaded plugin 
6. Disable current instance of plugin
tender shard
#

I think auto updates are a shitty idea

tender shard
ashen quest
#

i m working for a youtuber

ashen quest
tender shard
#

can't be. If the plugin.yml is correct, and the class is at that location, this error can't possibly be thrown

#

can you send the .jar here?

ashen quest
#

sure

#

is it fine if i send in dms

gleaming grove
tender shard
ashen quest
#

kinda confidential

tender shard
#

if at all, you should do a /myplugin update command

gleaming grove
tender shard
#

You cannot "reload" your plugin this way

dusk flicker
#

better have a way to disable auto updating

tender shard
#

Buuut spigot has an auto update feature bbuiltin

#

create a folder "update" in "plugins"

#

put your new version inside there

#

on next restart, spigot will automatically replace the jar

opal juniper
#

it does ?

tender shard
#

yes

tardy delta
#

oh didnt know

dusk flicker
#

yep

visual tide
#

since when

tender shard
#

that's like 10 years old

opal juniper
#

what a stupid feature

dusk flicker
#

at least 1.8

tardy delta
#

cool tho

tender shard
#

but nonone ever really used it

visual tide
#

bruh

opal juniper
#

makes more sense

gleaming grove
visual tide
#

does it go by plugin name in plugin.yml

tender shard
#

probably

tender shard
gleaming grove
#

so I would need to create /plugins/update dictionary then load there new version of plugin, that's it?

visual tide
#

not gonna do that
i'm already subjecting myself to enough pain today, migrating to discord.py 2.0

tender shard
dusk flicker
#

funny enough I knew someone that coded an entire custom update directory not knowing there was one built in

gleaming grove
#

nice ๐Ÿ˜„

visual tide
#

or restart urself ๐Ÿ˜„ ๐Ÿ˜„

visual tide
#

mild oof

tender shard
#

but it was like 3 years ago

#

and the worst thing is, I even knew about the update folder, I just forgot about it because I didnt code for bukkit between 2013 and 2018

visual tide
ashen quest
tender shard
#

we found the problem - windows ignoring file CaSe but java doesn't ๐Ÿ™‚

sterile token
#

I want to ask a dude how would you make a reload command? Only reload the files or everything (files, dbs connection, etc) ?

tardy delta
#

depends on what you need

eternal night
#

just don't make a reload command 5Head

#

reloading is just always pain, just restart the server

native talon
#

Why is it not finding the constructor for the NamespacedKey?

"package me.dor7123.mypluginda;

import org.bukkit.NamespacedKey;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

public final class MyPluginDA extends JavaPlugin implements Listener {
@Override
public void onEnable() {
System.out.println("Plugin Works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
getServer().getPluginManager().registerEvents(this,this);
}

@Override
public void onDisable() {
    System.out.println("Plugin is Off");
}

@EventHandler
public void onPlayerRun(PlayerMoveEvent event){
    System.out.println("The player is moving");
    Player player = event.getPlayer();
    PersistentDataContainer p = player.getPersistentDataContainer();
    if(player.isSprinting()){
        System.out.println("Player is Sprinting");
        if(!p.has(new NamespacedKey(this, "agility", PersistentDataType.FLOAT))){
            p.set(new NamespacedKey(this, "agility", PersistentDataType.FLOAT, 0));
        }
        else{
            float currentExp = p.get(this, "agility", PersistentDataType.FLOAT);
            p.set(new NamespacedKey(this, "agility", PersistentDataType.FLOAT, currentExp+0.01));
            System.out.println("current exp is " + currentExp);
        }

    }
}

}"

tardy delta
#

only new NameSpacedKey(this, key)

chrome beacon
#

Also create a constant for that namespace instead of creating multiple instances each time

tardy delta
#

^^

native talon
#

like so?

#

public void onPlayerRun(PlayerMoveEvent event){
System.out.println("The player is moving");
Player player = event.getPlayer();
PersistentDataContainer p = player.getPersistentDataContainer();
if(player.isSprinting()){
System.out.println("Player is Sprinting");
if(!p.has(new NamespacedKey(this, "agility"))){
p.set(new NamespacedKey(this, "agility", PersistentDataType.FLOAT), 0);
}
else{
float currentExp = p.get(this, "agility");
p.set(new NamespacedKey(this, "agility", PersistentDataType.FLOAT), currentExp+0.01);
System.out.println("current exp is " + currentExp);
}

    }
}

}

fixed one

tardy delta
#

do people even listen

native talon
#

edited it

tardy delta
#

?jd-s may help too, just search a class

undone axleBOT
tardy delta
#

i hope i did not fuck up my arch install from yesterday

chrome beacon
#

Use Debian :)

native talon
#

I got the data container, why won't it check if it has it?

tardy delta
#

i used some ubuntu derives before

native talon
#

Player player = event.getPlayer();
PersistentDataContainer p = player.getPersistentDataContainer();
if(player.isSprinting()){
System.out.println("Player is Sprinting");
if(!p.has(new NamespacedKey(this, "agility")))

chrome beacon
#

Just plain debian

#

No need for Ubuntu or it's forks

tardy delta
#

ye ik that exists

#

i dont know

#

tryin something new ig

#

hmm yes i broke it again

#

just freezes

cloud crane
#
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
Gson gson = new Gson();
JsonObject jsonObject = gson.fromJson(response.body(), JsonObject.class);
returnString = jsonObject.get("value").toString();

return returnString;

com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive
I don't understand what i'm doing wrong

tardy delta
#

got a json primitive as body?

chrome beacon
#

Yeah

cloud crane
tardy delta
#

idk

dapper steppe
#

Would anyone like to help me out with an apocalyptic survival plugin? I don't mind if you're new or experienced with dev ๐Ÿ™‚

cloud crane
#
{
  "head": {
    "link": [],
    "vars": [
      "wikipedia_id"
    ]
  },
  "results": {
    "distinct": false,
    "ordered": true,
    "bindings": [
      {
        "wikipedia_id": {
          "type": "typed-literal",
          "datatype": "http://www.w3.org/2001/XMLSchema#integer",
          "value": "27529"
        }
      }
    ]
  }
}
#

My output rn

crisp steeple
#

@cloud crane

cloud crane
#

Thank you

native talon
#

double currentExp = p.get(this, "agility");
p.set(new NamespacedKey(this, "agility"), PersistentDataType.DOUBLE, currentExp+0.01);

#

why is the set not working?

#

I'm trying to increment the data type by 0.01

sterile token
#

Copilot recommendations, no idea what does btw

ornate patio
#

is there an event for when a player left clicks an entity

#

not exactly damage, because sometimes the entity is invulnerable

ashen quest
#
Caused by: java.lang.NoClassDefFoundError: com/annihilation/core/zlib/components/scoreboard/sender/ObjectiveSender

Even tho that file does exist

sterile token
native talon
#

double currentExp = p.get("agility", PersistentDataType.DOUBLE);

I'm getting this - incompatible types: java.lang.String cannot be converted to org.bukkit.NamespacedKey

sterile token
buoyant viper
#

probably somethin along the lines PlayerDamageEntityEvent or EntityDamageEntityEvent

native talon
#

I'm not spamming it's a new error

sterile token
buoyant viper
#

im guessing

#

?pdc

native talon
buoyant viper
ashen quest
#

the dependency code is in my package

buoyant viper
#

double check the plugin jar with winrar or 7zip? idk

buoyant viper
honest mica
#

anyone use worldguard extra flags?

buoyant viper
#

i havent PDCs myself yet

ashen quest
honest mica
#

i would like to know if i can run 2 commands when a player enter an area, if so, how can i do it?

sterile token
#

What can be happening? intellij doesnt detect a project module

honest mica
tardy delta
sterile token
#

I cannot find that on google

sterile token
#

๐Ÿ˜‚

tardy delta
#

does some calculation between two vars

buoyant viper
#

id say it takes arguments a and b and then returns something depending on what u have in the functional interface

honest mica
sterile token
tardy delta
#

f.e. return calculate(1, 2, (a, b) -> a + b)?

#

not sure about the lamdba, never used a binaryoperator

buoyant viper
#

same

sterile token
#

Same

buoyant viper
#

just guessing its functional tbh

sterile token
#

1 sec

#

I tell you

tardy delta
#

tell me the method it has

sterile token
#

BinaryCaculator is functional interface which extends BiFunction

tardy delta
#

ik lmao

ivory sleet
#

BinaryOperator*

tardy delta
#

tell the method signature

sterile token
#

apply() should came from BiFunction

tardy delta
#

ah

#

binaryfunction is (a, b) -> c right?

ivory sleet
#

yes

tardy delta
#

(a, b) -> a + b should work then for binaryoperator

#

maybe even Integer::sum

sterile token
#

never seen copilot recomending this before

#

really extrange

tardy delta
#

never used copilot

sterile token
#

Conclure also do u use maven modules?

ivory sleet
#

happens

sterile token
#

Because im having big troubles with it It doesnt a detect a project module

#

I have done everything lmao

#

Invalidate cache, restart IDE and OS

#

๐Ÿ˜ฎโ€๐Ÿ’จ

tardy delta
#

i only had problems with maven and modules

sterile token
#

So shity

#

Doesnt detect the module i dont know if maven issue or IDE issue

tardy delta
#

reload from disk?

sterile token
#

I wil ltry

#

I invalidate cache again

#

I will try that

#

works know

twilit roost
#

Im going insane rn..
Im trying to send Plugin message from Spigot to BungeeCord and ๐Ÿ”„
But it just doesn't end on the other side??
BungeeCord:
https://paste.md-5.net/upibaqakuh.cs
Spigot:
https://paste.md-5.net/filujavata.cs
BPMSEntries are same on both sides:
https://paste.md-5.net/xidimuxifo.java

Usages:
Spigot:
On Boot
BPMS.getInstance().pingBungeeCord();
BungeeCord:
Also on Boot

        this.getProxy().getPluginManager().registerListener(this,new BPMS());
        BPMS.getInstance().registerChannels(this);

        BPMS.getInstance().pingAllServers();

any ideas of what im doing wrong?

hot wolf
#

How can I op players onJoin? Because if i do it in the event, it doesn't work because the player isn't actually on the server yet

twilit roost
#

onJoin event -> runTaskLater for few secs -> op

#

also why are u op'ing players?

hot wolf
hot wolf
#

and setOp(true) doesn't work so ye

twilit roost
#

even if after those 100 tries the player wouldn't get opped -> kick with message

hot wolf
#

I've got an idea from that, thanks :D

twilit roost
#

np

carmine nacelle
#

Is there an event for when a block's data changes? I want to listen for when a beehive's honey level hits max

crimson comet
#

I'm trying to use the new PlayerProfile and PlayerTexture api in Bukkit. It seems to work with ItemStacks:

    private void initSkullMeta(@NonNull ItemStack playerHeadItemStack, @NonNull Head head) {
        final var headSkullMeta = Optional.ofNullable((SkullMeta) playerHeadItemStack.getItemMeta());
        headSkullMeta.ifPresentOrElse(meta -> {
            meta.setOwningPlayer(Bukkit.getOfflinePlayer(NOTCH_UUID));
            meta.setDisplayName(head.getName());
            meta.setOwnerProfile(ownerProfileService.createOwnerProfile(head));
            playerHeadItemStack.setItemMeta(meta);
        }, () -> {
            log.warn("Couldn't find player skull meta.");
        });
    }

I verified with my HeadsInventory plugin that this works without issues.
But for blocks, I'm unable to get the PlayerProfile to stick:

    private void setOwnerProfile(@NonNull Block headBlock, PlayerProfile ownerProfile) {
        final var headBlockState = headBlock.getState();
        if (headBlockState instanceof Skull skullBlock) {
            skullBlock.setOwnerProfile(ownerProfile);
        }
    }

All heads are looking like steve heads. the PlayerProfile here is fetched using the exact same ownerProfileService.createOwnerProfile(head).

chrome beacon
#

A block state is a copy

#

You need to set it again after modifying it

crimson comet
#

How do I set the state back? I didn't see a setState method

chrome beacon
#

Just call update() on it iirc

crimson comet
#

Ahhh, I've seen that in the past, but I completely forgot about that method

#

Thanks! I'll check that out!

carmine nacelle
#

Is there an event for when a block's data changes? I want to listen for when a beehive's honey level hits max... anyone

chrome beacon
#

Don't create item meta like that

#

The only case it will be null is if the item is air

#

And creating a new item meta won't help since it can't have one

#

Looks like result is air

carmine nacelle
#
    @EventHandler
    public void onStateChange(BlockPhysicsEvent event) {
        if(event.getChangedType().equals(Material.BEEHIVE)) {
            Beehive oldHive = (Beehive) event.getSourceBlock().getState();
            Beehive newHive = (Beehive) event.getBlock().getState();

            if(newHive.getHoneyLevel() != oldHive.getHoneyLevel()) {
                Bukkit.broadcastMessage("updated");
            }
        }
    }

Why does this error? Saying

Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.CraftBeehive cannot be cast to class org.bukkit.block.data.type.Beehive (org.bukkit.craftbukkit.v1_19_R1.block.CraftBeehive and org.bukkit.block.data.type.Beehive are in unnamed module of loader java.net.URLClassLoader @18769467)
eternal night
#

wrong beehive

#

you want org.bukkit.block.Beehive

#

not the block data interface

carmine nacelle
#

You cant check honey level of the block

#

not part of the object

eternal night
#

then get its block data

#

not the state

carmine nacelle
#

changed my import too

crimson comet
#

No more dependency on NBT API anymore, woo!

eternal night
carmine nacelle
#

?

eternal night
#

I was giving you the import for using state

#

if you wanna use block data, you'd need the one you had

carmine nacelle
#

omg lmao

#

Hmmmm its not erroring but its not doing anything

opal juniper
#

sounds good to me

#

no errors = success

chrome beacon
carmine nacelle
#

bruh

#

why are there 2 for the same thing

#

I need to get the before and after

chrome beacon
#

Source is for what triggered the update

#

In this case the beehive

#

And getBlock is what got updated

#

Which also is the Beehive

carmine nacelle
#

so..theres no way to find the block before change and after change.

#

pretty useless event if thats the case.

chrome beacon
#

You could just create the event yourself and add a PR

carmine nacelle
#

Well how can I make the event if I can't get the before/after bloc

#

k

#
    @EventHandler
    public void onStateChange(BlockPhysicsEvent event) {
        if(event.getChangedType().equals(Material.BEEHIVE)) {
            Beehive oldHive = (Beehive) event.getSourceBlock().getBlockData();

            new BukkitRunnable() {
                public void run () {
                    Beehive newHive = (Beehive) Bukkit.getServer().getWorld(event.getBlock().getWorld().getName()).getBlockAt(event.getBlock().getLocation()).getBlockData();

                    if(newHive.getHoneyLevel() != oldHive.getHoneyLevel()) {
                        Bukkit.broadcastMessage("updated");
                    }
                }
            }.runTaskLater(cadiaBees, 20L);
        }
    }
#

i even tried a delay

chrome beacon
#

If you want to detect the max why do you need the old honey level?

#

You just need the new one

carmine nacelle
#

I need to detect when theres a chance

#

when it goes up

#

change**

chrome beacon
#

Not really

#

Just make your own event and PR it

carmine nacelle
#

PR?

eternal oxide
#

?contribute

carmine nacelle
#

whats PR in this?

chrome beacon
#

PR is just short for Pull Request

carmine nacelle
#

Idk how this could even be turned into an event

#

because i cant check the things required to make it one

chrome beacon
#

I meant make the event and add it to spigot

#

To make it simply find where in NMS its changed and place an event call there

carmine nacelle
#

oof..

#

nms sucks

chrome beacon
#

I actually think it's fine to work with

#

Mojmaps have made things so much easier

carmine nacelle
#

Idk where to even begin

chrome beacon
#

Beehive block would be a good start

carmine nacelle
#

on change though..?

chrome beacon
#

You'll have to look around a bit to find that

#

I don't have access to my pc so I can't help with that

drowsy harness
#

Is there a way to check if a BoundingBox is inside a block?

eternal oxide
#

Box.isInside(Block#getBoundingBox()) or it might is Eclosing

grim ice
#

how can a boundingbox be inside a block

#

blocks are supposed to be inside boundingboxes

drowsy harness
#

teleport armorstand inside block

#

and check if armorstand is in block

eternal oxide
#

he menas is the box completely inside the Block I assume

#

ah in that case just check Block.getBoundingBox().contains(location)

drowsy harness
#

alright

eternal oxide
#

there are many methods

drowsy harness
#

^^ sheep??

eternal oxide
#

do you mean you want to see if any part of a block is inside the ArmorStand?

drowsy harness
#

yea

#

if the armorstand hitbox and the block hitbox is colliding in any way

gleaming grove
#

Is /update folder still supported by Spigot? I've open the the spigot load plugins code and don;t see any usages of /update directory

wet breach
eternal oxide
#

yes, updating is before loading

gleaming grove
#

so m I doing something wrong, why this plugin is not loaded?

carmine nacelle
#

well the names are different

#

idk if that matters.

eternal night
#

it does

#

at least on spigot

gleaming grove
#

there should be console output [JW_Music] loaded and [JW_Piano] loaded

carmine nacelle
#

what is the update directory even for?

wet breach
#

when the server restarts it auto replaces/updates them

carmine nacelle
#

never knew that existed

eternal oxide
#

Note: he said restart, not reload

wet breach
#

its a bukkit feature that existed for many years ๐Ÿ˜›

gleaming grove
#

but I does not copy update/JW_Piano to plugins folder for some reason

grim ice
#

guyus

wet breach
gleaming grove
#

look at this @wet breach

wet breach
eternal oxide
#

it will also only update an existing plugin. its not for adding new

wet breach
#

not sure which wiki you are listening to, but doubt its the bukkit/spigot one ๐Ÿ˜„

visual tide
#

๐Ÿคทโ€โ™€๏ธ

wet breach
#

lol so yeah not even official sources

visual tide
#
BukkitWiki

This guide explains how to install most basic plugins on your server. You must already have a running CraftBukkit server set up and have knowledge of how to use the Minecraft server console. If you do not have a server set up please go to Setting up a server and follow the instructions there. This guide does not cover setting up an SQL database ...

carmine nacelle
#
    @EventHandler
    public void onStateChange(BlockPhysicsEvent event) {
        if(event.getChangedType().equals(Material.BEEHIVE)) {
            Beehive hive = (Beehive) event.getSourceBlock().getBlockData();
            org.bukkit.block.Beehive hiveBlock = (org.bukkit.block.Beehive) event.getSourceBlock().getState();

            CustomHive customHive = cadiaBees.hiveManager.getHiveForBlock(hiveBlock.getPersistentDataContainer());

            if(customHive == null) return;

            if(hive.getHoneyLevel() == hive.getMaximumHoneyLevel()) {
                int storedHoney = cadiaBees.hivePDCManager.getStoredHoneyAmt(hiveBlock.getPersistentDataContainer());
                int maxHoney = cadiaBees.hiveLevelManager.getHiveLevel(cadiaBees.hivePDCManager.getHiveLevel(hiveBlock.getPersistentDataContainer())).getMaxHoney();

                if(storedHoney != maxHoney) {
                    hive.setHoneyLevel(hive.getMaximumHoneyLevel() - 1);
                    event.getBlock().setBlockData(hive);
                    event.getBlock().getState().update(true);
                    Bukkit.broadcastMessage("Saved you from cringe");
                }
            }
        }
    }

Getting a concurrent modification error which kinda makes sense..but idk how to get around it. Basically.. I have custom hives, right. The hive itself has a max internal honey level of 5, but my plugin can go up to 13. So I am trying to make it so if the hive gets to 5 (full) but my plugin's hive isnt ALSO at full, it sets it back to max -1

grim ice
#

hexademical numbers get bigger in this way:
0xFF is 255
but 0xF is 15
because when converted to binary code,
0xFF is 10101010
and 0xF is 1010
and when converted to decimals
10101010 is 255
and 1010 is 15?

wet breach
carmine nacelle
#

Itโ€™s safety

#

But that ainโ€™t my issue lmao

minor fox
#

Is a wiki.vg for earlier versions available anywhere?

wet breach
#

it doesn't do anything

visual tide
carmine nacelle
#

How so? My function im calling returns null if there isnโ€™t a hive at that location.

daring lark
#
        Zombie zombie = (Zombie) location.getWorld().spawnEntity(location, EntityType.ZOMBIE);
        zombie.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(hp);
        zombie.setHealth(hp);
        zombie.getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(attackSpeed);
        zombie.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(damage);
        zombie.setCustomName(ChatColor.GREEN + "[" + ChatColor.YELLOW + level + ChatColor.GREEN + "] " + ChatColor.AQUA + "Zombie");
        zombie.setCustomNameVisible(true);
    }```  what is wrong with this  code?
wet breach
#

just click on the protocol version you want ๐Ÿ™‚

grim ice
visual tide
daring lark
#

wait a sec

carmine nacelle
#

@wet breach soooo.. any ideas

daring lark
#

Caused by: java.lang.StackOverflowError

#

that error is so long

#

can i paste it somewhere?

visual tide
#

?paste

undone axleBOT
chrome beacon
#

You probably caused an infinite loop

lost matrix
daring lark
#
        at CakeRPG.jar//me.placek.cakerpg.listeners.RpgMonsterSpawnListener.onEntitySpawn(RpgMonsterSpawnListener.java:21)```
wet breach
daring lark
chrome beacon
lost matrix
chrome beacon
#

There's your issue

lost matrix
#

XD

chrome beacon
#

SpawnListener > Spawn Mob > SpawnListener

#

Repeat

lost matrix
carmine nacelle
lost matrix
carmine nacelle
#

im not even doing that tho

#

well..

#

maybe its cause im setting data inside of a data change check?

lost matrix
#

Could also be caused by thread fkery

carmine nacelle
#

I dont really know how else I could do this tho

wet breach
#

Reload Count: 90

lost matrix
lost matrix
carmine nacelle
#

Eh

#

I update code way too much to restart every time

#

Would take like 2x the time to get stuff done.

wet breach
#

except the plugins you have, don't work right with reload

carmine nacelle
#

Iโ€™m not using the other ones for stuff relating to this so idrc

#

Havenโ€™t had an issue yet

wet breach
#

they caused your server to crash and complain about something that is most likely not even an issue

carmine nacelle
#

?

#

It was my infinite loop that caused the crash

wet breach
#

that would make things crash too, but so does using reload enough times, in your crash using it 90 times lmao

grim ice
#

my cash

carmine nacelle
#

Iโ€™m gonna use it even more just to spite u ๐Ÿฅบ

#

Jkjk

#

I donโ€™t use reload on my production server this is just a test server

patent fox
#

is there a way to change player fishing speed?

daring lark
#

yes

#

u can change it by using getHook().setApplyLure(number);

#

u can read more about this event

mortal hare
#

I wonder if you could bypass 1.19.1 microsoft chat moderation by disabling online mode and using mojang API manually to check if that particular player is premium player.๐Ÿค”

carmine nacelle
#

Why do we gotta keep catering to the weak minded instead of trying to reinforce them

#

๐Ÿค”

mortal hare
#

Offline mode servers should disable microsoft friends list

#

Thus you couldnt report those players

chrome beacon
#

Or just accept that chat moderation is a thing

mortal hare
#

Hypothetically maybe its possible to fool the client that he's joining offline mode server

chrome beacon
#

Just like anywhere else

mortal hare
#

Via packet manipulation

carmine nacelle
#

Not everyone enjoys living in a censored dystopia.

mortal hare
#

i dont trust microsoft

#

Permabanning players

#

for spelling vagina in the chat

chrome beacon
#

They probably won't ban you for that

eternal night
#

offline mode server is the most overkill way to remove chat reporting

eternal oxide
#

"probably"

carmine nacelle
#

on PUBLIC servers fine but private servers?? im gonna say whatever I want

eternal night
#

you can just like, write a 10 line plugin

noble lantern
#

Just write a packet modifier that doesnt send the list of players to report to the client

#

ez

eternal night
#

or just, hear me out, send everything as a system message

carmine nacelle
#

this game has gone downhill since microsoft took over

eternal night
#

almost like that is a lot easier

noble lantern
#

cant report me if i never said the message

#

and screenshots arent valid proof ๐Ÿค”

mortal hare
noble lantern
#

but i nthat case

#

how does mojang trust servers to validly report messages??

#

Couldnt i just like report ppl on my own server sending my own report data

eternal night
#

by cryptographic signing

noble lantern
#

Yes but server would have to interfere somehow

mortal hare
#

Chat formatting plugins: Write that down, write that down!

noble lantern
#

has to be some stage where this can get changed/modified it

eternal night
#

not really

#

the client signs it

carmine nacelle
#

big tech turning into CCP

eternal night
#

mojang knows the players public key

#

if you report a message claiming it was from player a but the signature is not one generated from player a it doesn't count as a reportable message

mortal hare
#

i hope paper or spigot implements a patch dedicated to reporting

noble lantern
eternal night
#

wat

#

no

#

the server cannot modify that message anymore

rough drift
#

get iris, now you have shaders

noble lantern
eternal night
#

Yea from the client ?

#

in a packet ?

#

lemme get kennys writeup

quaint mantle
#

sodium gives so much better performance are you drunk

mortal hare
#

everything is done on the client

noble lantern
#

So the client sends a raw string message but also signs a message

eternal night
#

and sends a signature

rough drift
#

now, I got a question, how do I check if an inventory is an inventory is a player inventory (so the one you get when clicking on the chest in creative, or opening your inventory in survival)

noble lantern
#

so wouldnt mojang know a player sent a no no message even with system messaging?

#

(Thats where im getting at here)

eternal night
rough drift
mortal hare
eternal night
rough drift
chrome beacon
#

The fact that Optifine is still straight up overriding bytecode is sad

eternal night
#

if the message is a system message it does not contain a signature

#

and mojang won't consider it

#

the client won't let you report it either

noble lantern
#

time to make that plugin now

carmine nacelle
#

cancel the report packet from the client lmao

noble lantern
#

just Bukkit.broadcast the chat message content with a monitor level on the chat event

noble lantern
rough drift
#

no

#

you gotta cancel

noble lantern
#

server doesnt middle man

carmine nacelle
#

oof

rough drift
#

Monitor is not allowed to cancel (shouldn't, it can but shouldn't)

noble lantern
#

well

#

im canceling monitor

#

bc a lot of chat plugins use HIGHEST

rough drift
#

how will you see then

noble lantern
#

and monitor is + 1 above that

mortal hare
#

Microsoft cant defeat community moderation

noble lantern
#

oops

mortal hare
#

Microsoft is getting weird since they reintroduced snooper, but without an option to disable it anymore

noble lantern
#

didnt eman to reply haha

carmine nacelle
#

chat moderation shouldnt exist thats what the "Block" button is for.

rough drift
noble lantern
carmine nacelle
#

yeah

mortal hare
#

Basically since in 1.16 minecraft clients collects telemetry forcefully (theres a mod to remove that shit but still)

carmine nacelle
#

what happened to "sticks and stones may break my bones but words will never hurt me"

noble lantern
#

legit grew up on being called the n word in a voice chat

carmine nacelle
#

LMAO

#

best time of my life

#

xbox live voice chat

noble lantern
#

ppl just soft now a days

carmine nacelle
#

its sad

noble lantern
#

ppl dont realize you dont gotta fight

carmine nacelle
#

and we keep reinforcing it.

noble lantern
#

fight or flight response kicks in? You fucking flight it

molten hearth
#

is there any way to use ACF properly for a command without subcommands

carmine nacelle
#

oh ye

molten hearth
#

I cant use annotations on a constructor and it wants to force me to do super(cmd)

carmine nacelle
#

for anyone that cares heres how i fixed my issue

    @EventHandler
    public void onStateChange(BlockPhysicsEvent event) {
        if(event.getChangedType().equals(Material.BEEHIVE)) {
            Beehive hive = (Beehive) event.getSourceBlock().getBlockData();
            org.bukkit.block.Beehive hiveBlock = (org.bukkit.block.Beehive) event.getSourceBlock().getState();

            CustomHive customHive = cadiaBees.hiveManager.getHiveForBlock(hiveBlock.getPersistentDataContainer());

            if(customHive == null) return;

            if(hive.getHoneyLevel() == hive.getMaximumHoneyLevel()) {
                int storedHoney = cadiaBees.hivePDCManager.getStoredHoneyAmt(hiveBlock.getPersistentDataContainer());
                int maxHoney = cadiaBees.hiveLevelManager.getHiveLevel(cadiaBees.hivePDCManager.getHiveLevel(hiveBlock.getPersistentDataContainer())).getMaxHoney();

                if(storedHoney != maxHoney) {
                    new BukkitRunnable() {
                        public void run() {
                            hive.setHoneyLevel(hive.getMaximumHoneyLevel() - 1);
                            event.getBlock().setBlockData(hive);
                            event.getBlock().getState().update(true);
                        }
                    }.runTaskLater(cadiaBees, 10L);
                }
            }
        }
    }
noble lantern
#

you cant rly get around that

mortal hare
#

I would switch to linux, but Nvidia driver support is trash, electron apps run at 15 fps and desktop environments lack such simple things as show desktop (KDE has it, but it doesnt function how i normally use)

noble lantern
#

unless the constructors empty ofc

#

then super() is not needed but you should still call it

molten hearth
#

well if I just do a subcommand without super it doesnt get registered

grim ice
#

my mom

noble lantern
#

you do sub commands by extending a command class?

#

HelpIslandArgument extends HelpCommand extends Command

?

molten hearth
#

say I do this to register a command ```java
public class PrefixCommand extends BaseCommand {

public PrefixCommand() {
}

@Subcommand("prefix")
public void onPrefix(CommandSender sender) {
    sender.sendMessage("gotcha");
}

}
``` then /prefix doesnt get registered in game

mortal hare
#

Also XFCE got ported to GTK3 and now it looks like an alient with touchscreen decorations on top of dragging bar which is shitty

rough drift
#

it has show desktop stuff

#

iirc

mortal hare
#

Gnome eats ram

#

And cpu

next stratus
noble lantern
next stratus
#

That'll be like registering /test prefix

mortal hare
#

I use custom windows iso and it eats less resources, also is more stable than linux

#

But i love linux terminal

next stratus
#

Custom windows iso ๐Ÿง

mortal hare
#

Yea, basically stripped out version of windows 10

noble lantern
#

god yall do some of the most extreme shit in here

mortal hare
#

Which uses 700 mb of ram at idle and 1% of cpu usage of an I3-6100 CPU

rough drift
#

Tiny10

#

get Tiny10

molten hearth
noble lantern
molten hearth
#

I was looking at the examples from ACF

#

uh

#

yeah its private

#

but its not a library

noble lantern
#

Have no idea what ACF is

molten hearth
#

well thats's a rip

#

then no its not my library I thought you meant the code I sent lol

rough drift
#

also, why is the survival/creative player's inventory CRAFTING rather than PLAYER

carmine nacelle
#

tf

rough drift
#

because PLAYER exists

#

also, what's the crafting inventory then

noble lantern
#

because calling super() makes a new instance of the extending class

#

and each sub command would essentially make a new command instance

molten hearth
#

this was the example they had lol

#

the issue is I understand how to use subcommands but not base commands

#

but I think I just add my annotations to the whole class

noble lantern
rotund pond
#

Hello !
What's the difference between these too tripewire please ?

rough drift
#

one's the block

#

the other's the item

noble lantern
#

^

molten hearth
#

well im extending BaseCommand not ResidenceBaseCommands

rotund pond
#

Eh, there's a tripewire block ? O_o

#

Ah wait

molten hearth
#

I think I just needed to do java @CommandAlias("prefix") public class PrefixCommand extends BaseCommand {

rotund pond
#

I'm dumb

#

xD

noble lantern
#

well then i have no idea how that command lib is used

rotund pond
noble lantern
#

ask in theyre disc support bc ive never seen anyone ask for help about this

#

or on theyre github

rotund pond
#

What's the question about ACF ? I use it in all my plugins

noble lantern
#

(aka papermc)

mortal hare
#

Its due to how players survival inventory have two inventories one for storage and another one 2x2 crafting inventory in which you can craft all sorts of items

noble lantern
#

or that works

molten hearth
#

I guess something like ```java
@CommandAlias("prefix")
public class PrefixCommand extends BaseCommand {

public PrefixCommand() {
    super("");
}

@Default
public void onPrefix(Player player, String string, @Default("1") int integer) {
    //blabla
}

}

#

is the way to do it

#

without subcommands

rotund pond
#

That's it

noble lantern
#

seems aids to work with

#

so many annotations

molten hearth
#

thats the beauty of it

noble lantern
#

no lol you can do something way simpler

mortal hare
#

Creative inventory doesnt provide crafting inventory to work with so type returned is different

molten hearth
#

I prefer annotations over if statements

noble lantern
#

just seems over bloated and complicated for no reason

#

you can use FunctionalInterfaces

molten hearth
#

sounds complicated

noble lantern
#

I dont have docs updated for sub commands yet

#

essentially its just this.registerSubCommand(TheSubCommand.class)

Which has a execute() method for the sub command to execute

#

600 line command classes with 200 annotations seems eghh

molten hearth
#

idk the annotations look nice imo

#

I also prefer command classes

noble lantern
#

redempts libs for commands is nice too iirc

#

most libs are command classes

#

redempts mine and aikars are all command class based, as well as other libs out there

#

most extend BukkitCommand/Command

ivory sleet
#

annots are nice apart from the inflexibility that comes with them

noble lantern
#

oh shit

#

i forgot i did support for my annotations like this

#

lmao

noble lantern
#

looks annoying to deal with

ivory sleet
#

well, almost 0 abstraction (in terms of oop)

#

and testing can be meh as well

grim ice
#

tbh

#

ive been coding for like a year and something now

#

i never really found a really good for testing

#

well a year isnt taht much but still, ive never found a good use for testing honestly

noble lantern
#

dont want your command classes being wildly different

ivory sleet
#

tests have big cons and pros

ivory sleet
noble lantern
#

if it works yay

ivory sleet
#

since well your command classes are the lowest level components of a cmd interface (that delegate to your internal modules)

grim ice
ivory sleet
#

so they're bound to be impl based quite hard

grim ice
#

i dont know why your abstract class is named like that

noble lantern
grim ice
#

yeah

quaint mantle
#

AbstractCommand ๐Ÿ˜ฆ

noble lantern
ivory sleet
noble lantern
#

But its an ApiCommand z_aCRYYY

ivory sleet
#

because otherwise developers deliver shit

noble lantern
#

plus its not rly abstract cause you dont implement anything

#

the extension is for auto register rly and to provide methods

#

eg this.subArgument

#

no abstraction for it

#

so i feel AbstractCommand is slightly misleading

grim ice
#

u register arguments

noble lantern
#

its auto register

grim ice
#

u dont get it

#

rn what ur doing, is creating the arguments and the code for when theyre run

#

in the same scope

#

i would make it so u register the args in ur constructor

noble lantern
#

well

grim ice
#

but have a listener type of thing to replace that

noble lantern
#

its in the constructor there

ivory sleet
#

constructors should generally as in almost always only construct the instance, they should scarcely ever run logic or other things because that usually reduces reusability and flexibility, but over that AbstractBlah is usually a good convention because it tells the developer that you provide a base data structure with a nice derivation api

noble lantern
#

the constructor doesnt even run this code

ivory sleet
#

presuming you are faithful to the convention ofc

noble lantern
#

it simply stores the function

#

hence why functional interfaces are so nice

#

code isnt ran until you run it

#

its basically storing a function as a variable reallynice_not

grim ice
#

you dont get what im saying

#

instead of having the lambds there

#

instead, having listeners as another methods

noble lantern
#

youd have to show an example cause it makes no sense what your saying

#

just sounds like over complication

#

those lmabdas can be called anywhere

#

even after the commands registered

grim ice
#

yeah

noble lantern
#

i just used constructor to show an example

grim ice
#

imma add an example a sec

noble lantern
#

doesnt need to be in there, its in there due to my own lazyness

#

new MyCommandClass().registerSubCommand().registerSubCommand().onPlayerSender().onConsoelSender();

You can chain it liks this if you rly wanted to but

#

eh

grim ice
#

instead of .onPlayerSender() have a method onPlayerSending() outside of your constructor, and same for onConsoleSender() and arguments

grim ice
noble lantern
#

it is onPlayerSending

#

its executed on player sending

grim ice
#

dude

noble lantern
#

all this just sounds like over complification

grim ice
#

i believe what i said is very obvious

#

i cant understand what you dont get in what i said

noble lantern
#

Why would i want to have a listener

And said it doesnt need to be in the constructor the class extends ApiCommand

grim ice
#

have i ever denied onPlayerSender isnt an event though

noble lantern
#

you can call these methods everwhere

ivory sleet
#

2Hex is probably proposing you the rule that every line of a function should be at the same level of abstraction, in which extracting a function that you call would be more polite to the reader

grim ice
#

oh wait

noble lantern
#

oh are you just talking about my naming conventions

noble lantern
#

cause if not then i dont get one bit

#

i dont get why ide want to make a listener for these

#

wasted resources, wasted cpu cycles

eternal night
#

Premature Micro optimization hits hard

noble lantern
#

i didnt even optimize this, its a simple system

#

you store the function in functional interfaces and call them later

#

it just stores a function

ivory sleet
#
//better
void doStuff() {
  doMoreStuff();
  invokePostEvent();
  cleanUp();
}

void doStuff() {
  try (var scope = scope()) {
    Manager manager = executeWithListener();
    Task task = scope.fork(() -> awaitResultData());
    scope.join();
    manager.update(task.resultNow());
  }

  Eventbus.INSTANCE.post(FetchDataEvent.create());
  System.gc();
}
noble lantern
ivory sleet
#

just as an example

#

the first one is much more polite to the reader

#

because the reader can if they want to... exit early

chrome beacon
#

System.gc() ๐Ÿ’€

ivory sleet
#

ye just had to come up w sth lol

noble lantern
grim ice
#

bruh i was writing a whole paragraph for it ๐Ÿ˜ข

#

well anyways brb

ivory sleet
#

yeah but the constructor example ๐Ÿ’€

noble lantern
#

you can call the set methods wherever whyever

#

well i said i was lazy lol

#

its my testing code

ivory sleet
#

mye

noble lantern
#

the name of the class is quite literally TestArgument kek

#

only thing you can change after the commands registered

#

is methods like setCommandName ofc

#

for obvious reasons

ivory sleet
#

well my point was that you'd make the lambda expressions into normal functions and then just call blah::someMethod

#

(idk if 2hex meant the same thing)

noble lantern
#

would need to figure out how to transform my functional interfaces to a method referance but definatly doable but

#

the Lambda actually provides methods too

#

for the SubArgument api user

#

so youd likely need to have a class extending SubArgument, which wouldnt be that nice

ivory sleet
urban kernel
#

how do i get an entity's max health

#

im using 1.15.2

noble lantern
#

there its actually stupidely simply (Dont rip me for static or code style its just an example)

#

and you have access to all methods

noble lantern
urban kernel
desert loom
urban kernel
#

yeah idk how to get them

#

Cannot resolve method 'getMaxHealth' in 'Entity'

noble lantern
#

use the Attributes like theone said

#

Entity#getAttribute

#

all list of attributes ^

urban kernel
#

also lets say i had a command (/sethealthrows 10)

#

i would need to multiply args by 20 to make it 10 rows of health, correct?

urban kernel
# noble lantern Entity#getAttribute

like so?

                    ((Wither)ent).setMaxHealth(Double.parseDouble(args[0]) * 20);
                    ((Wither)ent).setHealth(((Wither) ent).getAttribute("GENERIC_MAX_HEALTH"));```
gleaming grove
#

Is it possible to assign metadata to armorstands ?

chrome beacon
#

Yes

gleaming grove
#

so how to do that?

chrome beacon
#

I recommend using pdc

#

Metadata is old

gleaming grove
#

oke

chrome beacon
#

?pdc

chrome beacon
urban kernel
#

cos it wants a double not an attrib

chrome beacon
#

Get the value of the attrubute

urban kernel
#

how

chrome beacon
#

getValue I'd assume

urban kernel
#

looks that way

noble lantern
#

use getDefaultValue if you want the actual base max health

getValue returns its current live value of that entity iirc

hard socket
#

help please

#

I guess its from the itemmeta but I am not sure

chrome beacon
#

Well Intellij has given you a few of the possible causes

noble lantern
#

haha

hard socket
chrome beacon
#

ItemMeta is null when the item is air

hardy pivot
#

Hi, i need some help with Unicode fonts.
I still don't get it how to create the GUI.

I found there are 2 ways to do it.

1.- Custom Items that look like the inventory background
2.- Text that looks like the inventory background

The first would be to create an item-stack with the material from the resource-pack you replaced, but I don't know if that's possible.
And the second way to do it I don't understand how it works

I hope and someone can give me a small example of how to show the texture on the screen. With or without open inventory

Thank

hard socket
urban kernel
#

why cant i use event#getPlayer in my playerdeathevent

hard socket
urban kernel
#

?

desert loom
#

use getEntity() it returns the player

chrome beacon
hard socket
chrome beacon
#

And?

hard socket
#

saving works but getting it doesnt

noble lantern
#

Entity#getKiller returns a non-null Player if the entity was last killed by a Player

#

if getKiller == nulll; entity wasnt killed by player so return

#

and then just getKiller when u need for that event (getKiller shouldnt ever be null for that event)

left swift
#

Is it possible to make custom firework shape?

chrome beacon
#

You can spawn particles in a shape

#

Just use pdc to detect the custom shape when it explodes

#

Cancel the vanilla one and spawn your own

#

You will probably get an awnser faster by using google

noble lantern
#

i think javadocs might have the max value (morice)

chrome beacon
#

Check if the ItemMeta is Damageable

#

Make sure to use the right import

noble lantern
#

i keep forgetting spigot has 2 damagables

#

kinda annoying ngl

#

use instanceof

#

wait

#

what version you on

#

@wind blaze

#

i can make that code super short if your on newer versions

if (itemMeta instanceof Damagable theDamagable) {

}
#

use that if your always on 1.19

#

older java versions that wont work so do note

ancient plank
#

Java 16 ftw

chrome beacon
#

17 ftw

#

LTS :)

gleaming grove
#

armorStand.remove(); could I unremove Entity?

visual tide
#

no

#

you can spawn a new armorstand

#

but .remove kills it

gleaming grove
#

right

#

somebody know if capacity of the var example = new List<>(1000) will be decreasing after removes content?

buoyant viper
#

shouldnt

#

unless u call trimToSize

gleaming grove
#

I mean while init new List<Integer>() java creates Integer[10] under the hood and when I'm adding 400 new objects, Java replace Integer[10] with Integer[400]

terse pumice
#

What is the closest equivalent of EntityAddToWorldEvent (from the paper fork) in Spigot? And what are the differences?

buoyant viper
#

?jd-s

undone axleBOT
buoyant viper
terse pumice
buoyant viper
#

if u need exact functionality... u might have to use paper..

#

or try and do tracking using spigots provided events

terse pumice
#

ugh

#

If I use paper I can't upload it to Spigot ๐Ÿคฃ

hard socket
#

why is this not working?

#

no errors i cant get the item

#

its not giving me it

terse pumice
# buoyant viper or try and do tracking using spigots provided events

This is the code that I need to be working the exact same in Spigot. It's nothing too massive but I need the entities to be removed haha

@EventHandler
    public void onEntityLoad(EntityAddToWorldEvent event) {
        Bukkit.getScheduler().runTaskLater(plugin, () -> {
            Entity entity = event.getEntity();
            if (entity.getType() != EntityType.ARMOR_STAND) return;
            if (dataManager.getActiveArmorStandsSet().contains(entity.getUniqueId())) return;
            if (entity.getPersistentDataContainer().has(followerKey, PersistentDataType.STRING)) entity.remove();
        }, 1);
    }
buoyant viper
#

i mean CreatureSpawnEvent might be able to suit ur needs, idk

#

might have to look into where the events are called in their respective forks to see just what makes them different

terse pumice
#

I should be able to use CreatureSpawnEvent and ChunkLoadEvent

#

but back when I tried this before it didn't work

#

what about the equivalent of Bukkit.getCurrentTick() ๐Ÿ’€

buoyant viper
#

run a repeating task every tick to increment a number

terse pumice
#

...

#

.......

#

This is insane

buoyant viper
#

alternatively

#

maybe u could specify a world to track

terse pumice
#

I'll track myself lmao

buoyant viper
terse pumice
#

I reallly wish Spigot would combine with Paper ๐Ÿ‘€

#

Spigot Forums > Paper
Paper Code > Spigot Code

#

Yeah that's where the problem comes from ๐Ÿคฃ

hybrid spoke
#

spigot > paper

maiden cape
#

well the paper patches could simply be accepted into spigot

buoyant viper
#

they could, but then why use paper if spigot has it all

maiden cape
#

i'm p sure paper was created because spigot wasn't accepting patches fast enough

terse pumice
#

but it doesn't have it all, which is the problem

buoyant viper
#

depends on if that returns a copy or the original list id say

dusk flicker
quaint mantle
#

how would i make a circle in the FAWE api then count the blocks within that radius?

#

i cant find anything about making a circle with their api

#

i can find stuff about counting blocks but only in a EditSession

hardy pivot
#

Is there a way to send to lobby all the players when a server close?

dusk flicker
#

?jd-bc

dusk flicker
#

Loop the players and connect them to a lobby when the server closes

hardy pivot
#

Its tested?

dusk flicker
#

whats tested

#

you're in help dev, this is where you make plugins

hardy pivot
#

have u tested that event?

dusk flicker
#

why would I test it

#

you're trying to MAKE a plugin to do this correct?

#

ProxiedPlayer#connect(server) probably from ServerKickEvent and do some checking on the state / kick reason / server info

hardy pivot
#

what do u think to use onDisable to tp all to lobby server?

sullen marlin
#

literally the 17th plugin on spigot does that

mystic sky
#

even more ig

sullen marlin
#

so does the 2nd pluginb

#

lol

dusk flicker
#

Lol

terse pumice
#

@sullen marlin any chance of an EntityAddToWorldEvent being added to Spigot ๐Ÿ˜…๐Ÿ™

#

I am trying so hard to make my plugin work on Spigot but this one thing is the difference in a fair few of mine and my friends plugins that means we are held to Paper for some entity based parts of plugins

mystic sky
#

Or backport to your local that event ig

terse pumice
#

I want to be able to share my plugins on the Spigot Forums

mystic sky
#

Oh, is for public usage

dusk flicker
#

PR it

#

?pr

#

should be a command ๐Ÿ‘€ @vagrant stratus

#

?contribute

dusk flicker
#

oh

#

lmao

#

yeah read that @terse pumice and you can PR it yourself

mystic sky
#

me guen paper

midnight patrol
#

what would be the easiest way to give reciever of damage a massive knockback
im making an armor enchant called "ragdoll" (self explainitory)

gleaming grove
#

has spigot other options to change position of entity then teleportation? I would need to make immediate posiotion change of armorstand then this smooth one like on this video

noble lantern
#

other than that not really

#

down to NMS code most moveTo methods just use teleportation or the AI controller and make the entity walk

sinful rapids
#

package com.shampaggon.crackshot.events does not exist, I put crackshot addiction (Project Strutture, modules, dependencies add crackshot plugin)

gleaming grove
#

could I somehow override armorstand AI controller?

noble lantern
noble lantern
#

same with players

gleaming grove
#

hmm but AI controller send some kind of packets to client

noble lantern
#

certain NMS Entitys have the moveTo methods but throw errors when using theyre controllers

noble lantern
gleaming grove
#

so do I could sends it

noble lantern
#

what you COULD do

#

is server side spawn a zombie

#

and tell the client its a armor stand

#

with the appropriate data needed to render the blue keys in the air

#

and then attatch its client sided position to the zombies, and it will make the armor stand look like its moving like a zombie

#

its a dirty trick a lot of ppl use to spawn in fake players and just use mc's default AI controller

#

ofc u gotta disable the zombie actions and stuff, but it works

gleaming grove
#

like zombie is moving around but blue keys need to go up

noble lantern
#

give it levitation effect and control its speed

gleaming grove
#

omg

noble lantern
#

wont work on older versions tho ofc

gleaming grove
#

thats genious

noble lantern
#

i think 1.9 added levitation so 1.8 urs kinda screwed a little

#

yep 1.9

gleaming grove
#

ok i;m just wokring on Java 16 > minecraft versions

#

so 1.17 , 1.18 ,1.19 i guess

noble lantern
#

yep your all good for that then

charred pollen
#

how do i add only age 7 WHEAT?

noble lantern
#

only issue is idk how to actually control levitation speed

I assume setting the entities base speed will do

noble lantern
#

lemme double check

#

ah

#

its changed tooo

#

Ageable iirc

#

double check import

#

theres a block ageable and entity ageable

midnight patrol
#

ageable kept throwing errors for me

noble lantern
#

because you didnt instanceof check

buoyant viper
#

^

midnight patrol
#

ye i did

buoyant viper
#

?paste

undone axleBOT
noble lantern
#

CraftCrops is if your about to use NMS

midnight patrol
#

i forgot to add that to the msg i just sent tho

terse pumice
noble lantern
buoyant viper
#

wouldnt it be casting it to b(lock) and not getBlockData or am i weong

noble lantern
#

nah Ageable is a BlockData type

buoyant viper
#

o

dusk flicker
buoyant viper
#

whats CraftCrops tho

noble lantern
#

but you do need to check if BlockData is null before casting too

noble lantern
buoyant viper
#

ik

noble lantern
#

plus

#

Crops is deprecated

#

so CraftCrops would be to i would imagine

buoyant viper
#

is there a CraftAgeable? uwu

#

i wonder

noble lantern
#

there is infact no, and CraftCrops actually extends the NMS BlockData

buoyant viper
#

?jd-cb

#

damn

buoyant viper
#

?jd-s

undone axleBOT
noble lantern
#

but you should rly use Ageable

buoyant viper
#

?jd

buoyant viper
#

is there no doc for CB

dusk flicker
#

its not an api

noble lantern
#

^

dusk flicker
#

thus no javadocs* there may be some, but not an online version like Spigots/BC

buoyant viper
#

ig

noble lantern
#

Its mainly just meant to be used as a bridge

buoyant viper
#

just an intermediary :(

noble lantern
#

lol hnnh

#

CraftAgeable

#

they were thinking about it

buoyant viper
#

im a Genius

dusk flicker
#

Lol

noble lantern
#

kinda bugs me that state is static

#

spigot static abuse??

buoyant viper
#

nooo

#

theres probably some reason that field is the way it is

noble lantern
#

its cause getInteger is static

quaint mantle
#

is there a bilingual way of insert or ignore for both mysql and sqlite?

noble lantern
#

but they could of just slapped it in the constructor to initialize

buoyant viper
#

is it a property linker or something

noble lantern
#

just a integer holder for the crops age

quaint mantle
#

in my sql it's just "insert ignore" but in sqlite it is "insert or ignore"

noble lantern
#

doesnt sqllite replicate mysql statements

quaint mantle
#

i thought so

buoyant viper
#

theres also not really a standard for SQL isnt there

#

just an idea

noble lantern
#

yeah definatly differentiates

#

but for some reason i thought the 2 used same syntaxes

#

postgresql suuucks

warm mica
#

sqlite is worse

young knoll
#

SQLite will usually accept MySQL syntax

torn shuttle
#

Hey so I noticed that the player death event has the exp dropped which is half of the player's exp when they were alive, is there a safe way of getting how much exp players actually had before dying because I don't want to run into a scenario where some other plugin is already modifying the dropped exp and I end up doubling that amount, which may lead to xp duping exploits

#

aside from storing that amount and keeping it up-to-date that is

spring minnow
#

how do i damage an entity like if was attacked by another entity? (i can't use entity.attack(other entity)

torn shuttle
#

pretty sure there's a damage() in there

#

might be the only other way via the api

#

or maybe create a damage event?

spring minnow
spring minnow
torn shuttle
#

if you want the knockback you'll have to emulate that with vectors

#

no way around it

spring minnow
#

thanks anyway!