#help-development

1 messages ยท Page 1698 of 1

quaint mantle
#

maybe

ivory sleet
#

That comment

eternal oxide
#

use saveDefaultConfig(). the other line does absolutely nothing

ivory sleet
#

๐Ÿ˜ฌ

eternal oxide
#

?stash

undone axleBOT
last ledge
#

i am making a lobby selector plugin, can someone help me what do i do to send players to another server?

quaint mantle
#

Where do I compare?

    @EventHandler
    public void onDeath(PlayerRespawnEvent e){
        Player player = e.getPlayer();
        for(String locationName : locationsData.getCustomConfig().getKeys(false)) {
            if (player.getLocation().getWorld() == locationsData.getCustomConfig().get(locationName + ".world")){
                double x = locationsData.getCustomConfig().getDouble(locationName + ".x");
                double y = locationsData.getCustomConfig().getDouble(locationName + ".y");
                double z = locationsData.getCustomConfig().getDouble(locationName + ".z");
                Location location = new Location((World) locationsData.getCustomConfig().get(locationName + ".world"), x, y, z);

                player.getLocation().distance(location);```
I only come to this, I think I can use the locationsData to make a temp section, but I dont like that, do you have any other ways?
#

hmmm i just add another for loop, let me see if i can compare that way

eternal oxide
#
getConfig().set("path", location);
loc = getConfig().getLocation("path");```
quaint mantle
#

heh?!?!?!?!?!?

#

very good :Vvvv

eternal oxide
#

thats how you save and load locations in a config

quaint mantle
#

yes... that plugin i used as an example too old...

#

i need to replace those lol

#

thanks lol this actually reduce alot of spaces

eternal oxide
#

how about just getdata.set(args[0], player.getLocation())

quaint mantle
#

.......

#

actually you guys surprised me alot lol

#

becuz im dumb lol

quaint mantle
#

does anyone know how to register a fake cosmetic glow enchant

#

in 1.17.1

#

my old method broke and i rely on it pretty heavily

#

i wonder if we can use this?


    public boolean onCommand(@NotNull CommandSender sender, Command cmd, @NotNull String label, String[] args) {
        FileConfiguration getdata = getConfig();
        if (cmd.getName().equalsIgnoreCase("spawnset") && args.length == 1 && sender instanceof Player player) {
            Location playerloc = player.getLocation();
            String locationName = args[0];
            getdata.set(locationName, playerloc);
            return true;
        }
        if (cmd.getName().equalsIgnoreCase("spawnremove") && args.length == 1 && sender instanceof Player player) {
            String locationName = args[0];
            if (getdata.contains(locationName)) {
                getdata.set(locationName, null);
            } else {
                player.sendMessage(getConfig().getString("messages"));
            }
            return true;
        }
        return false;
    }```
#

instead of register the command

#

i use the cmd.getname

stark marlin
#

I'm creating a MySQL connection with this jdbc string, but the connection still causes EOFException (Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.) when the connection timeouts. Am I doing something wrong?
jdbc:mysql://" + getConfig().getString("Database.Hostname") + "/" + getConfig().getString("Database.Database") + "?user=" + getConfig().getString("Database.Username") + "&password=" + getConfig().getString("Database.Password") + "&autoReconnect=true

stone sinew
# quaint mantle does anyone know how to register a fake cosmetic glow enchant
// * Registers custom enchant to add glowing affect to items
public static GlowingEnchant glow = null;
public static void registerGlowEnchant() {
    if(glow == null && !isLegacy()) {
        glow = new GlowingEnchant(new NamespacedKey(Core.getInstance(), "GlowingEnchant"));
        if(Enchantment.getByKey(new NamespacedKey(Core.getInstance(), "GlowingEnchant")) != null) return;
        try {
            Field f = Enchantment.class.getDeclaredField("acceptingNew");
            f.setAccessible(true);
            f.set(null, true);
            Enchantment.registerEnchantment(glow);
        } catch (Exception e){
            e.printStackTrace();
        }
    }
}

public class GlowingEnchant extends Enchantment {
    public GlowingEnchant(NamespacedKey id) {
        super(id);
    }

    @Override public boolean canEnchantItem(ItemStack arg0) { return false; }
    @Override public boolean conflictsWith(Enchantment arg0) { return false; }
    @Override public EnchantmentTarget getItemTarget() { return null; }
    @Override public int getMaxLevel() { return 0; }
    @Override public String getName() { return null; }
    @Override public int getStartLevel() { return 0; }
    @Override public boolean isCursed() { return false; }
    @Override public boolean isTreasure() { return false; }
    
}
stone sinew
#

np

#

Anyone know how to stop the ender dragon from spawning (And stopping the boss battle from being created) without spawning a portal?
I've tried setting any variable that the dragon checks for to true so it doesn't spawn but it always does no matter what. (Unless there is a portal in the world.)

I've tried these so far.

WorldServer ws = ((CraftWorld) w).getHandle();
((CraftWorld) w).getEnderDragonBattle().generateEndPortal(false);
final Field field = ws.getClass().getDeclaredField("dragonBattle");
field.setAccessible(true);
Field modField = Field.class.getDeclaredField("modifiers");
modField.setAccessible(true);
modField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(ws.getDimensionManager(), null);
ConsoleOutput.debug(ws.getDimensionManager().isCreateDragonBattle()+"");
/*final Field field = ws.getDimensionManager().getClass().getDeclaredField("createDragonBattle");
field.setAccessible(true);
Field modField = Field.class.getDeclaredField("modifiers");
modField.setAccessible(true);
modField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(ws.getDimensionManager(), false);
ConsoleOutput.debug(ws.getDimensionManager().isCreateDragonBattle()+"");

Field prevKilled = ((CraftWorld) w).getHandle().getMinecraftWorld().getDragonBattle().getClass().getDeclaredField("previouslyKilled");
prevKilled.setAccessible(true);
prevKilled.set(((CraftWorld) w).getHandle().getMinecraftWorld().getDragonBattle(), true);
ConsoleOutput.debug(prevKilled.get(((CraftWorld) w).getHandle().getMinecraftWorld().getDragonBattle())+"");*/
proud basin
#

just kill the ender dragon

eternal oxide
eternal night
#

could also just change the exit portal block pattern

#

:>

eternal oxide
#

DragonBattle#i() is the method that decides if the dragon has been killed

stone sinew
eternal oxide
#

yep, its method i() that counts portal blocks

eternal oxide
stone sinew
eternal oxide
#

returns a boolean

#

if the portal is found

stone sinew
#

I'll look into it when I get on PC. Thx.

eternal night
#
Bukkit.getWorlds().forEach(world -> {
    try {
        final var level = ((CraftWorld) world).getHandle();
        final var dragonFightField = level.getClass().getDeclaredField("dragonFight");
        dragonFightField.setAccessible(true);
        dragonFightField.set(level, null);
    } catch (final ReflectiveOperationException exception) {
        exception.printStackTrace();
    }
});
#

worked perfectly fine for me

#

o.O

#

I am chilling in the end right now

#

no enderdragon or portal in sight

stone sinew
#

I'll try that too thx.

eternal night
#

disclaimer that is latest

#

and mojang mapped

stone sinew
#

Yeap

#

Spigots "latest" or 1.17.1?

eternal night
#

papers latest xD

#

but /shrug

#

concerning that a majority of servers run paper anyway, that does not matter

stone sinew
#

I don't run paper

eternal night
#

well, try it on spigot then xD

#

should hopefully still work

stone sinew
#

I will when I get on PC lol

eternal night
#

tho idk what your code is even doing. field.set(ws.getDimensionManager(), null); why call the dimension manager when you are getting the field from the WorldServer class

#

surprised that doesn't error you out

eternal night
#

lol xD

#

the NMS way

stone sinew
eternal night
#

I did xD 5 times in and /kill and still no dragon

paper viper
#

Paper > Spigot

stone sinew
stone sinew
paper viper
#

Sure, but that doesnt mean spigot is better

#

lol

stone sinew
#

Doesn't mean paper is either.

paper viper
#

Well, Paper has pretty much the same functionality of Spigot but the API has changes which I prefer to favor over

#

anyways imma not argue about this

cerulean jasper
#

What do people use to store simple .yml-s in data folder? I need to store data of uuid + region name (string)

eternal night
#

spigot configuration API usually

cerulean jasper
#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

eternal night
#

basically

#

but instead of the plugin configuration (which is the config.yml file) they use custom files

gilded musk
#

@ancient plank

#

I need help

#

I can't use bungecord latest version

#

U download latest but keep saying outdated

#

Why

#

Help

ancient plank
#

dont ping staff for help with server/dev stuff

gilded musk
#

Ok

#

Sorry

#

Can u help me pls

eternal oxide
vapid ibex
eternal oxide
#

there is nothing in that SS that would give that error

brazen bolt
#

Ayo

#

But wait

#

I wanna trigger a primed tnt if player didn't move for 5 sec, if he moves I wanna do nothing

#

Heo could I do that

eternal oxide
#

How many blocks are in your blocks?

slim kernel
#

Whats the best way to check if there is a Water source in a specific range of Blocks around the Player?

eternal oxide
#

"best" depends

#

how fast do you need to know?

#

what range?

#

how often?

cerulean jasper
#

What else is needed to listen to API event? I have this:


    @EventHandler
    public static void onPreBuyEvent(PreBuyEvent pbe)
    {
        //Something has been rented, store it in our yaml database.

        String buyerUUID = pbe.getBuyer().toString();
        String regionRentedName = pbe.getRegion().getRegion().getId();
        rentDataConfig.addDefault(buyerUUID, regionRentedName);
        rentDataConfig.save();
        rentDataConfig.reload();

    }

But it doesnt get triggered/called it seems, any ideas? I reviewed both plugin API side and my own code and it seems to be something wrong with my code

eternal oxide
#

remove static

cerulean jasper
#

Okay, that should be all?

#

Done, will test

slim kernel
# eternal oxide how often?

as fast as possible, between 0-30 Blocks radius, depends on how often the player is using it but max should be once ore maybe twice a second

eternal oxide
#

if the listener is correctly registered and the event exists

cerulean jasper
#

I dont know how to register a listener ๐Ÿ˜ณ

#

I might be missing that?

eternal oxide
cerulean jasper
#

All I did was put @eventhandler ting

slim kernel
eternal oxide
#

google "spigot how to register a listener"

cerulean jasper
#

Ok checking

#

oh wait

#

Yeah ok something like this, thanks

 getServer().getPluginManager().registerEvents(new MyListener(), this);
slim kernel
onyx shale
slim kernel
onyx shale
#

Not home rn so nope

slim kernel
#

okay

stone sinew
eternal night
#

it might just be named differently

#

as I said, mojang mapped

stone sinew
#

Yeah its suppose to be dragonBattle but like I showed above doesn't work either.

eternal night
#

you are on latest right

stone sinew
#

Yeap

#

I'm looking through the server jar right now. Ill let you know if the variable is different

eternal night
#

private final EnderDragonBattle dragonFight; is literally a variable on the WorldServer class

#

idk to what that gets obfuscated

stone sinew
eternal night
#

you do realize spigot is obfuscated in 1.17

#

its going to be some shitty single/double char name

minor garnet
stone sinew
#

The object (class) won't be a different name the variable might be though

eternal night
#

yes

#

@stone sinew its Q

#

on the latest spigot build

languid geode
#

Guys what happened to the package view on the jdocs

#

they are quite annoying to browse now

tacit drift
#

?

eternal night
stone sinew
eternal night
#

did it work out

languid geode
chrome beacon
#

It does?

stone sinew
eternal night
#

rip xD

languid geode
#

Oh come on mojang why the fuck did you put the functional code bit i need to modify in the WHILE!

#

:reee:

stone sinew
eternal night
#

sweet, yeah let me know if it worked on spigot

signal atlas
#

Guys i got this error what is the problem ?, i clone projects from github and i cant run projects.

ivory sleet
#

Believe you have to import it as an eclipse project

chrome beacon
#

Have you tried clicking the green run button on the left side

signal atlas
#

sorry my english btw

stone sinew
#

Ummm so I built against 1.17.1 and now Bukkit.getWorld(key) returns null... But the file exists...

eternal night
#

is the world loaded

#

if it isn't it will not be returned by that method

stone sinew
#

I used getWorld(key) to load the world in 1.16.5 xD

#

Any ideas why this doesn't work in 1.17.1?

shadow night
#

It goes on the permission/group plugin

stone sinew
#

So apparently in 1.17.1 you can't just use Bukkit.getWorld(<WorldName>) to load worlds anymore. You have to use Bukkit.createWorld(new WorldCreator(<WorldName>))

shadow night
#

Does the player in the below group has the permission?

stone sinew
#

Ugggg.... 1.17.1 breaks my void world generator to

#

Actually it might be because for no reason what so ever I have to make a new worldcreator object to load worlds now.

shadow night
#

Everythings right I don't see any issues

brazen bolt
#

Noone helped me

#

ToT

onyx shale
#

we can also roast you if you want

brazen bolt
#

T-T

quasi flint
#

also a possibility

stone sinew
eternal night
#

rip

stone sinew
#

Testing again I think the code was in the wrong spot. (The code I had to move because of 1.17.1 BS)

#

Worked! Let me test it a few more times to be on the safe side lol

eternal night
#

eyy sweet

stone sinew
#

Now if only I can work out why the server randomly holds on saving chunks in a world where the chunks are unloaded xD

tacit drift
#

and see if the world is present

#

Ooh

stone sinew
# tacit drift List worlds

Its not. in 1.16.5 it loaded the world from file. In 1.17.1 you have to use world creator to load and/or build the world

onyx basin
#

Hi, I'm creating and opening (for player) inventory every time, when player types command and I have to cancel InventoryClickEvent only in this inventory. What is the best way to refer to this inventory in the class that has applied InventoryClickEvent listener?

tacit drift
#

Check if inventory is instance of the inventory you wanted

#

The easiest way is to check for inventory name, but it's not recommended

onyx basin
#

But everytime when player typed command, I have to create a new instance of class that opens inventory for him

shadow night
#

what is static ._. and why?

quaint mantle
#

then ClassName.staticMethodHere()

#

et

quaint mantle
shadow night
#

?learnjava

undone axleBOT
shadow night
#

I think

quaint mantle
#

thanks

#

should say it there

digital kettle
quaint mantle
#

HashMap<UUID, Integer>

#

sure

#

what is the event for using experience bottles and how to get a player?

urban mirage
#

Then you can check if the player is holding an experience bottle

quaint mantle
urban mirage
#

Yeah, I've had that issue before, but it's not hard to workaround

idle cove
#

How would I check if there is another player the direction the player is looking and if they are in the players range as well as get 5 blocks Infront of the player?

quaint mantle
#

how?

urban mirage
#

Make a HashSet called playersToIgnoreForXPInteractEvent or something
When the event happens add the player to the set
And schedule a delayed task to remove the player from the map 1 tick later

Then at the very beginning of your event handler you can just do an if statement and check if playersToIgnoreForXPInteractEvent.contains(event.getPlayer() and only run your code if that is false

hasty prawn
#

That name is really long holy

idle cove
# quaint mantle getTargetBlock?

I want to spawn An explosion on a player if the user is looking at that player and if they are in range otherwise spawn a location 5 blocks Infront of the player how would I do that?

urban mirage
#

That's for checking if there is a player

agile crane
#

When I enable the anti-xray feature in the paper file, the chunks on the server are loaded too late.
how to fix ?

urban mirage
idle cove
#

Ok and if there is a player for their location do I do result.getlocation?

urban mirage
#

Err I can't remember if the raytraceresult has a location, if it does then you can use that

urban mirage
#

Or just use result.getEntity().getLocation()

idle cove
#

Ok thanks

#

And how would I get 5 blocks Infront of the player?

urban mirage
# quaint mantle how?

If you don't know how to make a HashSet then you probably don't know enough java to be making plugins. Everyone is going to tell you this, you need to learn java before you start trying to make plugins

quaint mantle
hasty prawn
#

Go look at your old code then! PeepoHappy

urban mirage
# idle cove And how would I get 5 blocks Infront of the player?

Vector math.
Get the player's eye location with player.getEyeLocation()
You can get the player's facing vector with player.getLocation().getDirection()
Multiply the direction by 5
then add that to the player's eye location

The code would look something like:

Location location = player.getEyeLocation().add(player.getLocation().getDirection().multiply(5))

urban mirage
#

Well re-learn some java, lol

idle cove
#

Thanks you I appreciate it very much

urban mirage
#

To create a HashSet is something like Set<Player> nameOfSet = new HashSet<>();

But I'm not going to spoonfeed the entire solution, so you need to learn some basic java stuff for yourself.

urban mirage
#

?learnjava

undone axleBOT
quaint mantle
#

is there an event for bottles of experience?

hasty prawn
#

Like, throwing them? ProjectileLaunchEvent

urban mirage
#

Sorry I didn't think of that one earlier.

quaint mantle
#

thanks

quaint mantle
urban mirage
#

No, I just imagined how I would code what you're asking

somber hull
#

entity.setVelocity(plr.getLocation().getDirection().multiply((sidewaysFloat == 0 ? 0 : (sidewaysFloat > 0 ? 0.10 : -0.10))).multiply((forwardFloat == 0 ? 0 : (forwardFloat > 0 ? 0.10 : -0.10))));

Sideways float is >0 when moving left, and <0 when moving right, and for forwardFloat its the same but >0 is forward, etc. How would i be able to set the velocity relative to the players direction without changing the Y

urban mirage
#

Can you clarify exactly what you're trying to achieve? that message is a bit confusing.

somber hull
#

So that the armorstand the player is sitting on goes foreward when hitting w and if the player is looking up it doesnt go up

urban mirage
#

Understood

quaint mantle
#

When I try to open my gui, I get the problem `openInventory(org.bukkit.entity.HumanEntity) cannot be referenced from static context.
To open:

            public boolean onCommand(CommandSender sender, String[] arguments) {
                Player.openInventory(gui.openInventory());
                return true;

The gui:

    public void openInventory(final HumanEntity ent) {
        ent.openInventory(inv);

Does anyone know how to fix it?

urban mirage
urban mirage
stone sinew
urban mirage
#

In this case you would cast your commandsender to a player then call open inventory

#

((Player)sender).openInventory();

quaint mantle
#

but check first or you'll get errors

urban mirage
#

Oh yeah sorry, of course

quaint mantle
#
if (sender instanceof Player player) {
    player.openInventory(inv);
}
else {
    sender.sendMessage(ChatColor.DARK_RED + "This command is for players!");
}
hasty prawn
#

pattern variable ๐Ÿ˜

urban mirage
#

Typo in that there @quaint mantle

#

remove the "player" in the instanceof check

quaint mantle
#

Heheh

hasty prawn
#

That's the pattern variable

quaint mantle
#

what a simpleton

hasty prawn
#

It's valid

urban mirage
#

wait what

#

oh!!!

#

That is so cool!

quaint mantle
#

my pattern variables are too high level for your redstone repeater mind

urban mirage
#

How did I not know that

#

I'm so sorry dude

quaint mantle
#

its java 16+

urban mirage
#

Ah ok

quaint mantle
#

its shrek ๐Ÿ™‚

urban mirage
#

Well hopefully I'm not too dumb for not knowing

#

Learn something new every day

quaint mantle
#

look up the java features for every update, you'll learn atleast 5 useful things

#

i love it

urban mirage
#

Yeah I should do that, thanks :)

quaint mantle
#

If its important to know,
the command to open is separate from the gui class

somber hull
#

I get player.getDirection

#

but idk what after that

urban mirage
#

Err I don't know how you're getting your inputs as to which way the player is moving

somber hull
#

it works

urban mirage
#

What exactly does it give you?

somber hull
urban mirage
#

Oh right

hasty prawn
quaint mantle
#

fair

urban mirage
#

That's going to be a little more complicated

#

I had to do this very recently

#

Let me grab my code

somber hull
#

aight

proud basin
somber hull
#

LOL

proud basin
#

๐Ÿ˜ข

urban mirage
#

                Vector velocity = p.getLocation().getDirection();
                velocity.setY(0);
                velocity.normalize();
                velocity.multiply(forwards);
                velocity.add(rightVector.multiply(-sideways));
                velocity.normalize();
                if (!NumberConversions.isFinite(velocity.getX())) velocity.setX(0);
                if (!NumberConversions.isFinite(velocity.getY())) velocity.setY(0);
                if (!NumberConversions.isFinite(velocity.getZ())) velocity.setZ(0);```
That should work. The end result is the variable "velocity" which should store a unit vector of which way the player should move.
#

@somber hull

somber hull
#

bet, hold up leme try and shove it in there

urban mirage
#

Essentially I create a "right vector" using some trigenometry

proud basin
#

yall got any suggestion on how I could make it look cleaner

urban mirage
#

Then I can multiply the forwards (facing) vector by the forwards float, the right vector by the sideways float (but negative bc I got it the wrong way around) and add em together

hasty prawn
#

add more pixels

urban mirage
#

It's lucky I was making a custom rideable entity a few weeks ago

proud basin
hasty prawn
proud basin
#

what do you mean add more pixels?

urban mirage
#

it was a joke lol

hasty prawn
#

Kinda

#

Basically up the resolution on your images

#

Or anti-alias them

urban mirage
#

oh

proud basin
#

4k images lmao

somber hull
#

@urban mirage wait. would i have to set the velocity by multiplying the vecotor?

proud basin
#

the images aren't blurry though

hasty prawn
#

They're not blurry but it's pixelated. The edges aren't curved really at all.

somber hull
#

yep

#

i got it

#

thanks

urban mirage
#

yeah

proud basin
#

I don't see can you show me?

hasty prawn
#

Just look at your world image, the curves are sharp

#

Or internet image whatever that is

proud basin
#

the border aren't images

hasty prawn
#

I can count the pixels

proud basin
#

huh for me they aren't like that

somber hull
#

hold up

proud basin
#

its prob the image from imgur

hasty prawn
#

That's from your imgur though, that's just zoomed in.

proud basin
#

I can screen share if you want to see it?

hasty prawn
#

I can't right now

somber hull
#

@urban mirage would i just change the setY to like -1 if i want the armostand to have gravity buyt not go up while it is being used?

proud basin
#

hm ok

urban mirage
#

yeah that should work give it a try

#

but idrk

somber hull
#

ye it works pretty nicely

#

and what if i want it to go up blocks, like horses?

#

would i have to check every time it moves if its near a block?

proud basin
#

my dumb font renderer sucks ugh

urban mirage
#

Ended up just removing that feature and implementing jumping

somber hull
#

lol

somber hull
proud basin
#

auto jump?

urban mirage
#

You could try checking the block in front

#

Might suit your needs

stone sinew
#

((CraftWorld) pastePoint.getWorld()).getHandle().setTypeAndData(new BlockPosition(os.getBlockX(), os.getBlockY(), os.getBlockZ()), m, 2);
I also tried 3, 2 & 1 but block physics are still running for some reason. Ex; sand falling, nether portals breaking etc...

somber hull
#

how do i get the block in front of the player, and down 2

#

again based on the players look direction

#

fuck it ill just add jumping

signal atlas
somber hull
#

set the from to the block

#

like

#

set pos 1 and 2 to the same block...

#

@urban mirage what did you do for jumping

#

mine is more like hovering

urban mirage
#

Let me check my code

#

So first of all

#

After the block of code I sent you

somber hull
#

velocity.setY((isJump ? (block.getType() == Material.AIR ? -0.50 : 1) : -0.50));

#

i have this for jumping

urban mirage
#

I'd do
velocity.setY(armorstand.getVelocity().getY())
The armostand's velocity Y will be the gravitational constant so that should work

urban mirage
#

Then when it's a jump I just set the Y velocity to 0.4

#

That's the value that I got from testing which seemed to do a 1 block jump approx

somber hull
#

ok..

urban mirage
#

lmk how that works

somber hull
#

so

#

@urban mirage

#

it jumps super high

#

wait

#

i set it to 1 not 0.4 ๐Ÿคฆ

urban mirage
#

lol

somber hull
#

wow

#

it looks really clean

#

thank you

#

it is still a hovercraft tho...

urban mirage
#

Not falling?

#

Or what

somber hull
#

it falls but if you hold space it hovers

zealous osprey
#

Anyone got a nice and comprehensive video on how to use and make custom fonts

urban mirage
#

Check armorstand is on ground first?

somber hull
#

is that not how fawe works idk

somber hull
#

yea works pretty well ngl

#

thanks

#

so, unrelated to what we were doing

#

but

#

if i create a object that extends ItemStack

#

and i then give that "item" to the player

#

can i later check it with instanceof CustomItem

ivory sleet
somber hull
#

?

ivory sleet
#

Not because itโ€™s object orientedly wrong

#

But ItemStack is just api

somber hull
#

yea thats what im asking

#

so would it work that way?

#

Like if i create an entity

#

And make it CustomVehicle

#

Could i check it later with instanceof?

ivory sleet
#

It may be cloned during the process between you writing to the ItemStack and the time when it actually gets sent into deep nms trees

somber hull
#

i assume not but im just checking

ivory sleet
#

Then when you want to retrieve it from letโ€™s say the PlayerInventory youโ€™re in reality getting a CraftItemStack back which has the identical properties to yours

#

However even so instanceof would fail by then

somber hull
#

ok, i thought so

ivory sleet
#

Why not just go with an nbt entry

somber hull
#

well i was asking relative for custom cars

#

if it works with itemstackjs it should work with entitys

ivory sleet
#

Very little about their new api

#

I used to when 1.8 wasnโ€™t considered legacy

ivory sleet
#

Cant you just use Block#setType?

somber hull
ivory sleet
#

Well why do you need to use fawe for this?

#

Fair

#

What version?

#

Let me see 1 sec

tardy delta
#

is there some way to give an instance of my command classes as parameter? I tried but the instance keeps calling super() and causes a stacktrace

ivory sleet
#

That looks cursed

tardy delta
#

cannot reference this before super has been called :/

#

well yea now it requires a boolean but therefore it needed an command class instance

ivory sleet
#

Sounds like rather bad design, whatโ€™s the real thing youโ€™re trying to achieve?

tardy delta
#

i wanted to set the tabcompleter for the command in the class itself

#

and let them be registered by the AbstractCommand class

ivory sleet
#

Use this

#

Operation pasteOperation = holder.createPaste(session, data)
.to(region.getMinimumPoint())
.ignoreAirBlocks(true)
.build();

try {
    Operations.complete(pasteOperation);
} catch (WorldEditException e) {
    throw new RuntimeException(e);
}

@weary geyser have you tried something like this?

lavish hemlock
#

I don't think he's trying to use it in a super call tho

#

oh yeah nvm

#

although why are you trying to pass an instance of the command subclass?

somber hull
#

Custom models?

somber hull
#

Like a custom model on a block

tardy delta
somber hull
#

and how do i model it?

ivory sleet
#

Well if you already know youโ€™ll use the instance itself, why not set it directly in the super class?

somber hull
ivory sleet
#

I believe you could invoke some other method from holder to create another type of operation?

#

Then blocks might be specifiable

#

Or if thatโ€™s done in session ยฏ_(ใƒ„)_/ยฏ

#

Think itโ€™s a clipboardholder

tardy delta
#

something like this?

ivory sleet
#

Yes

#

Though thatโ€™s very coupled but it it works Ig

ivory sleet
#

And then use customModelData in ItemMeta if itโ€™s items you wanna remodel

#

Hmm maybe yeah

#

Yup

tardy delta
#

and let the subclasses override the onTabComplete method iirc

ivory sleet
#

Yup

quaint mantle
#

why entitydeathevent is not working

ivory sleet
#

It is

quaint mantle
#

no

ivory sleet
#

Yes

#

Did you register it?

quaint mantle
#

yep im sure

ivory sleet
#

Also why suppress all

tardy delta
#

are you very sure?

somber hull
#

for custom model data

ivory sleet
#

Thatโ€™s a dangerous move my buddy

somber hull
#

can i put any number?

ivory sleet
#

Uh it takes an Integer

quaint mantle
somber hull
#

or does it have to be specific

#

all examples i have seen

lavish hemlock
#

it's dangerous because then you are unable to see other warnings

somber hull
#

are like 90001002

ivory sleet
#

Because you basically dissuade the ide from touching that code and giving you possible hints and feedback

quaint mantle
#

after everything was ok i will put that

young knoll
#

Any number above 0 I think

ivory sleet
#

I just go linearly hyper

quaint mantle
#

broadcasting a message doesnt need help right ?

ivory sleet
#

0, 1, 2 and so on

somber hull
lavish hemlock
#

it's kinda redundant to suppress all warnings if there are no warnings

quaint mantle
#

anyways why it doesnt get broadcasted

quaint mantle
ivory sleet
#

He might just wanted to suppress unused

lavish hemlock
#

in which case, you do @SuppressWarnings("unused")

ivory sleet
#

Indeed

quaint mantle
#

useless null checks that it could be the guy who configed it problem

#

12 warns

#

lets just ignore that

#

why the event

#

is not working

ivory sleet
#

No idea

lavish hemlock
#

@tardy delta don't roll your eyes at me

ivory sleet
#

If you assert that you register it and that you have the most up-to-date code on the server

#

Then Idk

quaint mantle
#

there is also no error in console

ivory sleet
#

Could avoid applying block physics and distribute the block placement for more than just a single tick

#

Letโ€™s say 4 trillion blocks

#

Why not do that over maybe some seconds?

#

I think smile wrote a comprehensive guide about it actually

lavish hemlock
lavish hemlock
tardy delta
#

is it useful to make my plugins instance static other than using it in static methods?

quaint mantle
#

My MySQL is time outing every hour

#

can anyone help?

tardy delta
#

also for an empty tabcomplete (so only player names appear) should i return an Collections.emptyList() or an new ArrayList<>()?

#

it returns an EmptyList so idk

shadow night
#

Is there a way i could develop plugins on mobile? To test plugins i can use geysermc or pojavlauncher, but i have no idea how i develop and build them.

tardy delta
#

tablet seems easier

lavish hemlock
#

Does the list get updated after it's added to the tabcomplete?

tardy delta
#

i still have to try it out

#

gimme sec

lavish hemlock
#

If not, use Collections.emptyList() bc it doesn't require redundant instantiation.

tardy delta
#

ok

#

ah did you mean if it updates with a new arraylist? in that case yes

lavish hemlock
#

As in, does it add anything to the list?

tardy delta
#
@Override
    protected List<String> tabComplete(@NotNull String[] args) {
        if (args.length == 1) {
            return StringUtil.copyPartialMatches(args[0], Arrays.asList("help", "accept", "request", "decline"), new ArrayList<>());
        }
        return Collections.emptyList();
    }
#

(i'm overriding an custom method)

#

that calls onTabComplete(...) smh

lavish hemlock
#

That'll probably work.

quaint mantle
#

bruh
when deathevent gets called ?

tardy delta
#

when something dies :/

quaint mantle
#

but it doesn't

#

when i kill an entity

#

nothing gets broadcasted

tardy delta
#

EntityDeathEvent right?

quaint mantle
#

yep

young knoll
#

Is it registered and annotated

quaint mantle
#

it is registered

#

and eventhandler is annotated

#
 @SuppressWarnings("all")
 @EventHandler(priority = EventPriority.HIGHEST)
    public void onDeath(EntityDeathEvent event) {
        Bukkit.broadcastMessage("OK");
tardy delta
#

remove the priority and try again?

quaint mantle
#

i set the priority cause it was not working ?

tardy delta
#

i dunno

#

it doesnt makes sense

quaint mantle
#

in eventhandler

tardy delta
#

then it wouldnt be executed if cancelled somewhere else?

quaint mantle
#

it would still get called if cancelled

#

wait what

#

bukkit is shit at naming things

tardy delta
#

wait priority highest is called first eh?

quaint mantle
#

the name is so misleading

tardy delta
#

my brain goes brr

#

xd

quaint mantle
#

ignoreCancelled stops the method from being called

tardy delta
#

uuhu

quaint mantle
#

who and why would someone name it that

tardy delta
#

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

quaint mantle
#

it should be inverted

eternal oxide
#

it shoudl be named ignoreIfCancelled

quaint mantle
#

^

#

or callCancelled

#

if (callCancelled) method.invoke(event)

scenic hornet
#

hi, so everytime i try to start up my server with a plugin i made i get this error:

[13:42:13 ERROR]: Could not load 'plugins\SpaceCoreMC-Plugin.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[patched_1.17.1.jar:git-Paper-266]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:160) ~[patched_1.17.1.jar:git-Paper-266]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:410) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:276) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1212) ~[patched_1.17.1.jar:git-Paper-266]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-266]
    at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
#

could someone help me?

eternal oxide
#

read the error Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml

scenic hornet
#

but it has a plugin.yml in it?

eternal oxide
#

no it doesn;t

scenic hornet
#

it does

eternal oxide
#

thats not your jar, and its in the wrong place in your project

scenic hornet
#

how?

#

my jar is in the com.jonfirexbox.spacecoremc folder and my plugin.yml is in the src folder?

eternal oxide
#

no thats your project

#

open your jar with 7zip or any compression util.

#

you will see it has no plugin.yml

scenic hornet
#

so where do i need to put the plugin.yml?

eternal oxide
#

it depends on how you are building

#

most here use maven, but it looks like you are using InteliJ Artifacts

subtle kite
#

you got a external libraries

scenic hornet
subtle kite
scenic hornet
#

so i need to make my plugin using Maven?

subtle kite
#

prob not

#

but it prob more ez

scenic hornet
#

?

eternal oxide
#

first open yoru jar and confirm it contains no plugin.yml

somber hull
#

custom model isnt working

scenic hornet
tardy delta
somber hull
#

i have the custom model data

#

as 123456

#

on both

#

and it no worky

#

wait

#

wtf

eternal oxide
#

ok, it looked like in your SS the plugin.yml is in the com folder of your project. Is it in the root of src or lower?

tardy delta
#

you cant set it on both

somber hull
#

i did smthng

tardy delta
#

or wait you can

somber hull
#

so

#

it has the acacia log texture

tardy delta
#

but that doesnt makes sense

#

:/

somber hull
#

but i want it to have the custom model...

#

leme send photos of my path

#

.minecraft\resourcepacks\testingpack\assets\minecraft\models\item

#

.minecraft\resourcepacks\testingpack\assets\minecraft\textures\custom

#

i have texture.png

scenic hornet
eternal oxide
#

good choice

#

just be sure you build using the maven menu (right side) and select package

tardy delta
#

if i do this and there is nothing in the path what does it return?


return new HashSet<>(homesFile.getConfigurationSection("homes." + p.getUniqueId()).getKeys(false));
somber hull
somber hull
#

its still missing model

tardy delta
#

lemme look at that tomorrow

chrome beacon
#

Are you making a plugin?

onyx shale
#

prob not as hes spamming the question

chrome beacon
#

Yeah thought so

signal atlas
#

guys when i clone a repository from github intellij cant run the projects , who can help me ?

chrome beacon
#

Did you click the run button

onyx shale
#

4head

signal atlas
#

wait i will ss

#

did you see orange J symbol ?

onyx shale
#

my god i can already tell thats some shit...

#

anyway considering it has a entry point the main.... you should be able to just run it

signal atlas
#

no have run button

onyx shale
#

nice fonted button on top called "Run"?

signal atlas
#

when i press run ->

onyx shale
signal atlas
#

ye i did

signal atlas
#

already i did run, but this issue comes ->

proud basin
#

add a configuration

ivory sleet
#

why do u have like 10 java projects inside one

signal atlas
#

this is my repository

#

from github

ivory sleet
#

I know in eclipse you can have that structure but intellij doesnt allow it unless all of those are submodules

#

but seems unlikely

signal atlas
#

I was working with eclipse before, and I had no problem

paper viper
#

Intellij => one project at a time

ivory sleet
#

ya

signal atlas
#

so how can i update my github projects ?

#

with no clone

onyx shale
#

well you are already having everything in 1 class,just make a new project and copy paste

paper viper
#

Well first of all, you shouldnt be having like 20 projects in one github repo

quaint mantle
#

is there any ide better than intellij idea?

ivory sleet
#

first upload each one of your projects to a separate github repository

onyx shale
#

raider

paper viper
quaint mantle
#

F

paper viper
#

Intellij is good tho

onyx shale
#

theyr own premium counterpart

ivory sleet
signal atlas
paper viper
#

why you ask?

onyx shale
#

also eclipse is decent

paper viper
#

I suggest to use packages

#

instead of folders

#

for that

quaint mantle
#

my edu license boutta run out in a month or two :>

paper viper
#

so its all in one projects

hot thistle
#

Does anyone here have experoence with the plugin qualityarmory?
i cant seem to get a audio effect to work and could really use some assistance

paper viper
ivory sleet
#

Eclipse has very imbecilic and unorthodox inspections, dont even bring up mspaint ide or netbeans lol

chrome beacon
onyx shale
chrome beacon
#

Or just do as Pulse said

paper viper
#

Get it for free for life

signal atlas
#

so what should i do ๐Ÿ˜„

paper viper
#

if you develop open source

quaint mantle
#

iโ€™m using ultimate since i can also use php and some other crap

paper viper
#

why php

#

๐Ÿฅฒ

ivory sleet
#

go to eclipse first and foremost

quaint mantle
#

cuz why not

ivory sleet
#

then push each project to their own separate repository

onyx shale
#

better tools for it?

paper viper
#

and also php is cursed

quaint mantle
#

ik

#

no need to tell me

ivory sleet
#

shade you can get a license if you maintain an os software

quaint mantle
#

how?

ivory sleet
#

google it, @spring canyon got it that way iirc

quaint mantle
#

aight

onyx shale
#

or... use community with a php extension

paper viper
paper viper
ivory sleet
#

lol yep, believe he rarely visits tho

quaint mantle
#

i checked

ivory sleet
#

what do u use php for anyways?

paper viper
#

"web development"

#

lol

ivory sleet
#

backend?

quaint mantle
#

making random crap on broken edition and web dev ofc

signal atlas
#

one more question, how can i fix this special characters ?

paper viper
#

wdym fix

#

like escape?

ivory sleet
#

well there's certainly a lot of options when it comes to backend web dev isnt there

signal atlas
#

for example its ลž

#

but intellij make "?"

ivory sleet
quaint mantle
#

time to give up on php

#

itโ€™s gey anyways

ivory sleet
#

lol

signal atlas
#

ty guys for everything ๐Ÿ™‚

ivory sleet
#

yeah for web dev use spring, or express or whatever thing but php ๐Ÿ˜„

spring canyon
#

Yes open source license good

onyx shale
#

with mvc or rest

ivory sleet
quaint mantle
#

the only thing i need rn is a pc

spring canyon
#

Rare sighting i know

ivory sleet
#

๐Ÿฅฒ

onyx shale
#

web dev i prefer typescript with react on visual code

quaint mantle
#

i sold mine today

spring canyon
ivory sleet
#

๐Ÿ˜ฎ

quaint mantle
#

instead of โ€˜upgrading itโ€™

onyx shale
#

or if im on mvc js with cshtml

quaint mantle
#

very smart

ivory sleet
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!

scenic hornet
ivory sleet
#

?paste the code

undone axleBOT
ivory sleet
#

also paste the error next time thx

spring canyon
#

It's beautiful ๐Ÿ˜Œ

scenic hornet
onyx shale
#

you are passing a gui class to a command wut?

ivory sleet
#

oh thats not your plugin?

quaint mantle
#

php looks like Javaxjavascript

ivory sleet
onyx shale
#

the poor inbred abomination resulting of those 2

scenic hornet
ivory sleet
#

then send the code ?

scenic hornet
#

but what code? the java code?

paper viper
#

Yes, what else?

scenic hornet
#

well im not sure i have never made a plugin before this is my first time so i don't know

signal atlas
ivory sleet
#

oh god

#

yeah

paper viper
#

i mean tbh packages are better

ivory sleet
#

Ig thats one way to handle it

paper viper
#

but if you're learning i dont think it matters

scenic hornet
ivory sleet
#

yeah ofc not going to work

#

You cannot just make a Car to a Cat and so on

scenic hornet
#

huh?

#

wait nvm i fixed it!

ivory sleet
#

pog

quaint mantle
visual tide
#

bit of a stupid question, but how do i turn a List<String> into a string with a newline between each item

eternal night
#
final String joinedString = String.join(System.lineSeparator(), list);
#

note, replace the sys.lineseperator with "\n" if you always need \n

quaint mantle
#

or

String joinedString = list.stream().collect(Collectors.joining(System.lineSeperator());
quaint mantle
#

i just like streams

#

might as well share one

visual tide
eternal night
#

with any char sequence

#

yes

#

you could also put "--"

visual tide
#

๐Ÿ‘

quaint mantle
#

how do i make an item spin on top of a block like spin in a circle

#

spoon feed me

#

๐Ÿฅบ๐Ÿฅบ

eternal oxide
#

๐Ÿฅ„๐Ÿฅ„

eternal night
#

don't items rotate on the client side by default xD

quaint mantle
#

Not that

eternal night
#

else I guess it is an armor stand with the item in their helmet slot

quaint mantle
#

like spin in a circle

#

tryna mess with crates so far i made so many animations for no reason

#

been thinking of that method for a while now

lost matrix
quaint mantle
#

idk where to start

quaint mantle
eternal night
#

most likely armor stand then

#

put the item into the helmet slot of the armor stand

#

and teleport it around

quaint mantle
#

yeah ik there is armor stand included

#

the teleport around thing is what im looking for

eternal night
#

I mean, like 7th grade math on how to calculate points on a circle using sin and cos waves

quaint mantle
#

yeah thatโ€™s the thing i have a way too decent memory

lost matrix
#

Get a fixed point (Location). Get a Vector of length N.
Teleport the as to fixed point + vector then rotate vector by Y degrees and repeat.

eternal night
quaint mantle
#

ty

eternal night
#

oh right, vectors have rotate methods now

lost matrix
#

You dont need to do the math for that. Spigot just lets you rotate a vector around an axis.

eternal night
#

expensive as fuck compared to a straight forward sin and cos combination

quaint mantle
#

meh ama just do math.cos and math.sin

#

and make a loop

eternal night
#

actually I lied

lost matrix
eternal night
#

the y axis does not use the general 3d transformation matrix

quaint mantle
#

i guess we have to try it

eternal night
#

rather implements the basic rotation matrix

#

so smiles method would be fine too

quaint mantle
#

ty guys

eternal night
#

np, the rotation might actually work a bit easier in terms of a scheduled timer

elder oyster
#

Hi, I'm trying to use the Configuration class of the bungee API, to retrieve data from config.yml. But I'm not 100% sure about how to use it correctly

Commands:
   discord:
      command: /discord
      types:
      - TEXT
      text:
      - 'Click here to join our Discord server!'
      hover:
      - 'discordlink'
      link: 'discordlink'

What would be method to retrieve the "discord" parameter, and all it's internal details?

#

Been coding too long with non-strict languages. Now I'm struggling ๐Ÿ˜„

idle cove
#

why is .getItemInHand and .getDisplayName deprecated?

quaint mantle
#

?jd

naive jolt
#

So I am trying to create a corpse following this tutorial (https://youtu.be/6LSScMdk0gU)
and it does not work it throws no errors but when i die ingame it does printout 2 console messages
so I think the problem is on the PlayerDamageEvent cause its not sending a message when i tell it to
another thing is I made a command to execute the class but no... still does not work on the class I even made sure whenever the class works it displays a message and well nothing happened i have my code down there for the entity

CorpseEntity Code - https://pastebin.com/N3XF41u8
ConsoleMessage - UUID of player ForbiddenBoXOri is 8ec9a87e-4e4f-4fb2-9d66-563329a74f7a
ConsoleMessage - ForbiddenBoXOri[/127.0.0.1:1307] logged in with entity id 335 at ([world]231.5, 69.0, -58.5)

shut wave
#

hey i have a problem with this, can someone help me?:(
this event doesn't work:

@EventHandler
void onBlockBreak(BlockExplodeEvent e) {
    e.setCancelled(true);
}```
eternal night
#

you'd have to register your main class as a listener

#

e.g. registerEvents(this, this)

#

that was for forbidden btw ^

shut wave
#

all the other events are working perfectly

eternal night
#

are you registering your listener

#

ah

#

what are you trying to prevent

naive jolt
#

wait onEnable?

eternal night
#

yea

naive jolt
#

I just register the event

eternal night
#

like any other listener

eternal night
naive jolt
eternal night
#

no no

#

like similar how you are registering the Gui listener

#

sorry if I wasn't clean enough on that

shut wave
eternal night
#

tnt explosions are entity explosions tho

#

it isn't the tnt block that explodes

#

but the entity "primed_tnt"

shut wave
#

so that's it

eternal night
#

or well the entity namespaced key is "tnt"

#

but you get the idea

naive jolt
eternal night
#

no xD

shut wave
#

then when is called that event?

eternal night
#

EntityExplodeEvent ?

shut wave
#

nono

naive jolt
#
getServer().getPluginManager().registerEvents(new Listener(), this);```
eternal night
#

well, yes but you don't need new Listener() you can just pass this

#

as this is your instance of your java plugin class which is also already a listener

naive jolt
#

oh yeah right

#

I already implemented it

shut wave
eternal night
#

what ?

shut wave
#

when is BlockExplodeEvent called :o

eternal night
#

when beds explode by right clicking

#

or other stuff like that

shut wave
#

oooh i get it

eternal night
#

generally when no entity is the cause

naive jolt
#

getServer().getPluginManager().registerEvents(this); hmm I get an error on 'this' and it says it wants a listener but then my class already implements listener (Main class)

shut wave
#

so tnt turn into an entity

eternal night
#

this, this

#

not just this

naive jolt
#

oh

#

...

#

soryy about that

shut wave
wild reef
#

Hey got a little problem...
I want to set a list of entity types inside a YamlConfiguration like this:

Set<String> types = getTypes().stream().map(EntityType::toString).collect(Collectors.toSet());
        pluginConfig.set("types", types);

Problem looks like this:

types: !!set
  SKELETON: null

It's just setting one type and also this strange !!set
Does anyone know why this happens?

eternal oxide
#

You are passing a Set not a List

naive jolt
#

@eternal night No way your just the best everyone just rejected my question thank u so much you saved a lot of time I can finally sleep (currently 2:02AM)

eternal night
#

np xD sleep tight

wild reef
eternal oxide
#

not easily, only the header can be preserved

wild reef
#

alright okay

proud basin
#

If I made a constructor for a class and I try to make an instance of the class is there a way to make one without filling in the perimeter it takes?

eternal night
#

you'd have to define a new empty constructor for this

proud basin
#

k

dry forum
#

why is https://pastebin.com/QxLFkQ2w giving me this error Caused by: java.lang.NullPointerException at com.jere.extra.economy.commands.onCommand(commands.java:28) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.5.jar:git-Paper-786]https://pastebin.com/bQHNzz0s it creates the file but doesnt write anything in it

loud swift
#

hey there, i was about to listen to the entityplaceevent, and saw it was deprecated

#

/**

  • Triggered when a entity is created in the world by a player "placing" an item
  • on a block.
  • <br>
  • Note that this event is currently only fired for three specific placements:
  • armor stands, minecarts, and end crystals.
  • @deprecated draft API
    */
#

Could anyone tell me what that deprecation means?

eternal night
#

what version are you on o.O

loud swift
#

1.17

eternal night
loud swift
#

ah, that could be

eternal night
#

besides that, this deprecation notice is added to new/fresh API

#

mostly deprecated so the API could potentially be changed after being released first

loud swift
#

thank you. Do you know if another event exists for item frame placement?

#

Because it says its fired for 4 entities, and thats not one of them

#

kinda weird, i'd totally expect it to be there

eternal night
loud swift
#

aahh yes

#

thanks a lot lynx!

balmy coyote
#

Hey, which event it's fired whenever player destroys Minecart_chest/hopper.
I can't seems to find any way to obtain minecarts Inventory and loot that's being dropped.

eternal night
#

np!

loud swift
dry forum
eternal night
#

maybe I should just become a professional javadoc linker

loud swift
#

wrp or args[1] is null then

dry forum
#

args[1] is set

loud swift
#

then wrp is null

eternal night
#

if you are on 1.16.5, upgrade to java 16

#

and get good null pointer exceptions :>

dry forum
#

wrong one 1 second

#

how is it null Economy1.apiCreateFile(args[1]); Economy1.apiGetFile(args[1]).createSection(args[1]); ConfigurationSection wrp = Economy1.apiGetFile(args[1]).getConfigurationSection(args[1]); i set it here?

loud swift
eternal night
#

getConfigurationSection is technically nullable

loud swift
balmy coyote
loud swift
#

try saving each value to a variable

#

and then print them

#

or use a debugger

dry forum
eternal night
#

e.g. validate you are actually registering the listener etc

balmy coyote
#

Entirely certain.

    public void test3(VehicleDestroyEvent e){
        System.out.println("vehicle Event");
        System.out.println(e.getVehicle());
        System.out.println(e.getAttacker());
    }```

[23:21:19 INFO]: Pickup Event
[23:21:19 INFO]: Pickup Event
[23:21:19 INFO]: Pickup Event
[23:21:19 INFO]: Pickup Event
[23:21:22 INFO]: Entity Damage Event
[23:21:22 INFO]: Entity Damage Event
[23:21:23 INFO]: Entity Damage Event
[23:21:23 INFO]: Entity Damage Event
[23:21:27 INFO]: Entity Drop Item Event
[23:21:27 INFO]: MINECART_CHEST
[23:21:27 INFO]: ItemStack{MINECART x 1}
[23:21:27 INFO]: passed
[23:21:27 INFO]: Entity Drop Item Event
[23:21:27 INFO]: MINECART_CHEST
[23:21:27 INFO]: ItemStack{CHEST x 1}
[23:21:27 INFO]: passed
[23:21:28 INFO]: Entity Damage Event
[23:21:29 INFO]: Entity Damage Event

#

Unless i'm blind

#

It doesn't exist in my list

loud swift
#

Economy.apiGetFile(args[1]) may be yielding two different objects?
Try saving the first economy.getFile variable and then using it for the second method
Other than that, i'm not sure, i don't use the normal spigot configuration system, kinda built my own because of some limitations it had

eternal night
#

where is the event handler annotation ?

dry forum
#

i dont think so args[1] is literally just for the name of the file

balmy coyote
#

Oh okay nvm not certain xD

eternal night
#

xD

balmy coyote
#

I miss-copied it

#

Either way. How do i obtain Inventory of the Entity

#

That's being dropped

eternal night
#

then cast it to that interface and you can access the container

balmy coyote
eternal oxide
#

you wouldn't, thats pointless

golden turret
#

how could i use something like player.chat but using the chat components?

eternal oxide
#

then thats a different question. I'd still nto use fawe

#

You probably want to look at 7smile7's resource on task timing

#

took a sec to find it

#

fawe is going be no faster

#

fawe doesn't actually replace blocks async

#

it uses a queue and jumps back sync to place

quaint mantle
#

hey just real quick

#

how do i set velocity of a particle

#

i.e; if i want smoke blowing east, etc.

eternal oxide
#

Nope, I don;t use fawe

quaint mantle
#

isnt fawe really bad compared to worldedit

young knoll
#

It was great back in 1.12

quaint mantle
#

guys

#

how to make sure that the experience does not fall out of the experience bottle?

shadow night
#

idk if theres an easier way, but check if theres any exp orbs (entities) in near of the position where the bottle exploded

#

And if theres, delete them

quaint mantle
#

how bottles?

shadow gazelle
#

Has anyone worked with making custom recipes for an anvil before?

#

Mine takes all of the items you put in and only gives you one of the output

#
if (inventory.containsAtLeast(new ItemStack(Material.GOLD_INGOT), 1) && inventory.containsAtLeast(new ItemStack(Material.SOUL_SAND), 1)) {
            inventory.setRepairCost(10);
            event.setResult(ItemStack);
        }
#

It makes sense that it does, but is there any way to stop it from doing that?

young knoll
#

You would have to mess with the anvil event to put the items back

shadow gazelle
#

There seems to be some issue with colored displaynames being seen right

#

When I try to find this item in an event it doesn't "see it"

ItemStack sv = new ItemStack(Material.GLASS_BOTTLE);
ItemMeta svMeta = sv.getItemMeta();
sv.setAmount(1);
sv.addUnsafeEnchantment(Enchantment.LUCK, 1);
svMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&5Soul Vial"));
svMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
sv.setItemMeta(svMeta);
#

I'm pretty sure it's an issue with the naming because just checking the enchant, flags, and material works

young knoll
#

How are you looking for it

shadow gazelle
#
if (inventory.getItemInMainHand().getItemStack().isSimilar(myItemStack)
young knoll
#

And myItemStack is identical?

shadow gazelle
#

Yes

shadow gazelle
quaint mantle
somber hull
#

plese help

#

lmk any information you need

somber hull
vast junco
#

How can I get the charges of a respawn anchor that has exploded? I've tried BlockExplodeEvent, which returns air as the block, and PlayerInteractEvent, which doesn't return the clicked block at all and throws an error: java.lang.NullPointerException: Cannot invoke "org.bukkit.block.Block.getType()" because the return value of "org.bukkit.event.player.PlayerInteractEvent.getClickedBlock()" is null. Is there any way around this other than storing the location and charge of every placed respawn anchor?

quaint mantle
#

still have no idea why this dont work

eternal oxide
quaint mantle
#

already man

eternal oxide
#

did you saveConfig()?

quaint mantle
eternal oxide
#

perhaps you registered two events

#

accidentally created two event classes

#

if they are two of the same class, yes

#

?paste your full event method

undone axleBOT
eternal oxide
#

ok, now where are you creating the instance of Bridges?

#

um, you add the player to a List

#

Lists can have duplicate entries

#

so teh first time they click it will run once

#

if they click again it runs twice

#

use a set

#

and use a Set

#

Set will not allow duplicates

somber hull
#

Ok

#

I have run into a problem