#help-development

1 messages · Page 1531 of 1

maiden briar
#
public final class ExceptionLogger extends Handler
{
    @Override
    public void publish(LogRecord record)
    {
        if(record.getThrown() != null)
        {
            Throwable exception = record.getThrown();

            if(exception instanceof DebugException)
                DebugMessage.exception((DebugException) exception);
            else
                DebugMessage.exception(new TvheeAPIException(record.getSourceClassName(), record.getSourceMethodName(), exception));
        }
    }

    @Override
    public void flush()
    {

    }

    @Override
    public void close() throws SecurityException
    {

    }
}```
`Bukkit.getLogger().addHandler(new ExceptionLogger());`
How can I filter exceptions from other plugins?
eternal night
#

isn't the bukkit loggers a shared one ?

maiden briar
#

Yes that is the problem, and Bukkit doesn't log the exceptions on the plugin's logger

eternal night
#

iterate over their loggers ?

#

they are exposed through JavaPlugin#getLogger

#

note tho, you would be injecting a class of plugin a into the class loader of plugin b

maiden briar
#

I just set my handler in JavaPlugin.getLogger() ?

eternal night
#

well their plugin instance

#

but yea I guess that should work

maiden briar
#

Ok let's try

opal juniper
#

jesus christ this maven package is downloading a lot of stuff

eternal night
#

keep in mind the "you are passing in a class from a different class loader into another plugin"

maiden briar
#

Ok

cyan bluff
#
world.spawnParticle(Particle.SPELL_WITCH, location, 1);
#

How would I modify this to make it so the spawned particle doesnt move?

eternal night
#
world.spawnParticle(Particle.SPELL_WITCH, loc, 1, 0, 0, 0, 0);
#

might work

#

the first three 0 are the random offset

#

x,y, and z respectively

#

that you do not want

#

the last one should be time/extra ?

maiden briar
cyan bluff
#

tried that but it didnt work

#

1.17 btw

eternal night
#

maybe spell_witch is just one of those particles that doesn't allow movement data ¯_(ツ)_/¯

cyan bluff
#

hmm ill playa round with it

dense goblet
#

or do I have to check if piston is sticky and then use the direction to figure out the retract location

unreal quartz
cyan bluff
#

yep it was the particle itself, it moved as it faded apparently

dense goblet
#

oh right, didn't notice it isn't a collection

eternal night
#

yea there is getBlocks in addition to getBlock

#

you can calculate the location using the direction provided in the event

dense goblet
#

does getBlock give me the piston?

#

I need to check if it is sticky

eternal night
#

there is isSticky

dense goblet
#

oh cool didn't notice

#

ty

eternal night
#

np

dense goblet
#

am I right in saying that if isSticky is false, BlockPistonRetractEvent.getBlocks will be empty?

alpine radish
#

Im confused a bit about bungee's event naming. I checked docs and figure it out something but not sure.

What's the name of event that called when player disconnects from server(ESC disconnect, not server change) will that event called when player is kicked too? [I think its PlayerDisconnectEvent]

What's the name of event that called when player connects to server(I need proxiedplayer instance, not server change)
[I think its PostLoginEvent]

silver wadi
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.equals(Object)" because the return value of "org.bukkit.event.player.PlayerInteractEvent.getItem()" is null
#
            if(event.getItem().equals(star)) {
#

supposedly the line triggering it

#

however

#

the line above is ```java
if(event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK))

#

i only get the error if i look at a block while doing this

#

it still works fine

alpine radish
#

Item and ITemStack is different things.

#

Item is an entity, while ItemStack isn't

#

You can get ItemStack from Item

#

Item#getItemStack() or something like this.

silver wadi
#

?

eternal oxide
#

getItem is null

#

you can't call .equals on null

silver wadi
#

I'm confused on that

eternal oxide
#

it says Nullable

#

you MUST test for null before using it

formal ice
#

w-who pinged me?!

eternal oxide
#

me

eternal night
#

your fault tbh

silver wadi
#

so check if its not null before i do it?

eternal night
#

with that name

eternal oxide
#

you have a stupid name and it auto completed for @ nullable

opal juniper
#
        npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, "jeffmcjefferson");
        Location location = event.getPlayer().getLocation();
        npc.spawn(location);
        location.setX(location.getX() + 30);
        npc.getNavigator().setTarget(location);

This makes the npc go like a million miles an hour - citizens api

Anyone know how to speed them down to walking speed?

alpine radish
#

while theres Item and ItemStack getItem()which returns ItemStack is bad naming. I hate this.

silver wadi
#

I'm still kind of confused on why it is null when i look at a block in the first place

formal ice
eternal oxide
#

Sorry 🙂

eternal oxide
eager sapphire
#

Kind of a random forum question, I've seen some plugin resource pages where the discussion section is disabled (not open for further replies) - how does one do that??

eternal oxide
#

archived plugins I expect

eager sapphire
#

hm no I don't think so, let me see if I can find an example. I swear I've seen it on a plugin I'm actively using

#

What is this magic

#

maybe it happened when it went inactive before libraryaddict picked it up?

eternal oxide
#

Possibly. I have no options to close any discussion on mine

opal juniper
#

Could I in theory just use the citizens api to make the entity and then manually move it?

#

Using the getEntity()

#

Hmmm, there is no way to make an entity “walk” though with spigot is there?

#

Only teleport them

#

Does an entity position packet make the client move an entity from x to y with animation?

#

============
I basically need a way to translate a player move event onto another entity.
The entity at the moment is a citizen npc

#

So I’m thinking that I could use packets but idrk. The path finding with the citizens api is a bit stupid

quaint mantle
#

import icalling.blindness.items.ItemManager;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class Commands implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(!(sender instanceof Player)) {
        sender.sendMessage("sorry console but only players can get cool kid items!!!");
        }
        Player player = (Player) sender;
        if (command.getName().equalsIgnoreCase("giveblindnessitem"))
            player.getInventory().addItem(ItemManager.blindnessball);

            player.sendMessage(ChatColor.BLUE + "You have been given the partner item of blindness");
            return true;
    }``` this gives me an errorr in the chat and tells me thats it a null item in the console
#

why is that

#

and also

#

the code for the item

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;
import java.util.List;

public class ItemManager {
    public static ItemStack blindnessball;

    public ItemManager() {
        createblindness();
    }

    public ItemStack blindnessball() {
        return blindnessball();
    }

    private void createEffectClearer() {
    }
    private static void createblindness() {
        ItemStack item = new ItemStack(Material.INK_SAC, 1);
        ItemMeta meta = item .getItemMeta();
        meta.setDisplayName(ChatColor.YELLOW + "Blindness Ball");
        List<String> lore = new ArrayList<>();
        lore.add(ChatColor.GRAY + "This is Ghanaman's cool partner item");
        lore.add(ChatColor.GRAY + "When you hit a player with this item they receive blindness");
        meta.setLore(lore);
        meta.addEnchant(Enchantment.LUCK, 1 ,false);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        blindnessball = item;
    }
sage swift
#

did you instantiate ItemManager

#

also you should probably item.setItemMeta(meta);

quaint mantle
#

which code

#

1 or 2

#

oh

sage swift
#

that should be self-explanatory

quaint mantle
#

2

#

i typed without thinking

#

sorry

#

lol

hexed hatch
opal juniper
#

if you send a lot

hexed hatch
#

I have no idea lol

opal juniper
#

i mean i guess if you send enough it will look smooth

quaint mantle
hexed hatch
#

I wasn’t using packets, I was just hijacking their navigation

quaint mantle
#

still sais the item is a null

eager sapphire
sage swift
#

did you instantiate the ItemManager

quaint mantle
#

wdym

sage swift
#

how are you gonna set the item if the method for setting the item is never called

quaint mantle
sage swift
#

where did you instantiate the ItemManager

quaint mantle
#
    public void onEnable() {
        // Plugin startup logic
        getServer().getPluginManager().registerEvents(new EventsForBlindness(), this);
        getCommand("giveblindnessitem").setExecutor(new Commands());```
sage swift
#

so do you see the issue here

quaint mantle
#

no

sage swift
#

show me just the code where you instantiate the ItemManager

#

just that line

quaint mantle
#

getCommand("giveblindnessitem").setExecutor(new Commands());

sage swift
#

where do you see the instance of ItemManager

quaint mantle
#

oh lol

#

im so dumb

#

ok

#

so

#

new ItemManager();

sage swift
#

👍

mortal hare
#

Windows 11

#

file manager

#

:poggers:

eternal night
#

could have just straight up copied linux based icons

#

would have been cuter

mortal hare
#

all i wanted is to everything to be UWP consistent on windows 10

#

also they've redesigned the settings finally

eternal night
#

all I wanted was for microsoft to be brave and implement windows 11 on top of linux kernel

mortal hare
#

yeaa that would be so cool

#

but it would require so much work

#

to port everything

#

including win 32

opal juniper
#

why is my yaw -33,000 ?

mortal hare
#

applications

#

i mean wine is here

#

but

#

they have source code they can port it, but that's just competitive in the market i guess

eternal night
#

macos introduced a compatibility layer when they shifted to BSD

wet breach
eternal night
#

also not like publishers could actually just disregard windows

#

they could have at least used their market share for something useful, now we have widgets

opal juniper
#

how do you make this packet

#

I have this:

PacketContainer packet = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE_LOOK);
packet.getIntegers()
        .write(0, this.plugin.npc.getEntity().getEntityId());
packet.getShorts()
        .write(0, (short) (1))
        .write(1, (short) (0))
        .write(2, (short) (0));
#

but im not sure how to get the angles

#

and what field they would be

quaint mantle
#

how do i build a jar file

#

i have a server jar but when i run gradlew.bat i cant find the built file

eternal night
#

spigot is build using the build tools

#

?bt

undone axleBOT
quaint mantle
#

but there servers are completly dead

mortal hare
#

git clone the repo

#

and use ./paper install

#

or smth like that

eternal night
#

paper is build using gradle applyPatches and then gradle paperclipJar

ivory garnet
#

How use a custom schedule bukkit

crude hound
#

hey I want to know what is not deprecated to create a schedule with the shedule api made by bukkit (I am in vc with @ivory garnet )

#

(1.16.5)

silver wadi
#

is there any difference to developing through paper and developing using spigot/bukkit?

#

i run my server on paper but i use spigot for developing

ivory garnet
#

idk

crude hound
silver wadi
#

i know

#

im just wondering if there are any differences

dense goblet
#

any idea why this is causing a ClassNotFoundException?
return houseInfoCache = (HouseInfo)SerializationUtils.deserialize(serialisedHouseInfo);
console:
Caused by: java.lang.ClassNotFoundException: kaktusz.kaktuszlogistics.modules.survival.world.housing.HouseInfo
HouseInfo implements Serializable and has a serialVersionUID

silver wadi
#

to developing the plugin straight from paper

crude hound
#

there is no visible differences

silver wadi
#

thanks

sullen dome
#

i'm getting confused with this shit every fucking time...

let's say, i type ?command arg0 arg1 arg2, args.length would be 3 right?

but i mean.. that would mean if there are no args after the command, wouldn't it then be args.length == 0?`
because it then tells me args[0] is out of bounds. so in this case, what would be the way to identify the command

#

btw, it's supposed to be if(args[0].equals(?command)) in the picture of course

eternal night
#

? is not a valid command being is it

sullen dome
#

it's not spigot

#

it's just a custom system. the prefix doesnt matter at all

#

just the args-system

eternal night
#

Well then the length of your args depends entirely on you

#

whether or not it includes the command name itself

#

who knows

compact haven
#

^^

sullen dome
#

i don't think you understand the question or i explained it wrong

compact haven
#

spigot removes the command label from the args array

#

you're system doesn't

#

that looks like JDA

eternal night
#

or maybe it does

#

who knows

sullen dome
#

oh spigot does?

#

interesting

eternal night
#

oh

#

right

#

yea you just split

compact haven
#

he's splitting an event message and setting that to String[] args

#

spigot does remove the command label from args

eternal night
#

in your case the command ?kill me pls would be [?kill, me, pls]

#

hence your two args

sullen dome
#

my only question would actually be... what would be the command in my string array? i mean, args[0] seems to be out of bounds

#

at least ij says so

eternal night
#

would actually result in an args.lenght == 3

compact haven
#

/mycommand arg1 arg2
args[0] is "arg1"
args[1] is "arg2"

in your system
args[0] = "/mycommand"
args[1] = "arg1"
args[2] = "arg2"

sullen dome
#

why length 3? doesnt java start counting with 0

eternal night
#

length is not counting

sullen dome
#

so length starts with 1?

eternal night
#

["hello", "there"] has length == 2

sullen dome
#

interesting

#

why is some stuff so confusing lmao

eternal night
#

where "hello" is found at arr[0]

quiet ice
#

it only makes sense

#

length is the amount of entries in the array, not the last valid index

quaint mantle
#

Hey,

Is there a way to check if a player starts/stops crawling?

sullen dome
quaint mantle
torn oyster
#
                    if (!fm.isPlayerFriendsWith(p, to)) {
                        if (fm.getFriendRequest(p, to) == null) {
                            if (!p.equals(to)) {
                                fm.request(p, to);
                            } else {
                                p.sendMessage(getConfigString(plugin, "friends.cannot-friend-self"));
                            }
                        } else {
                            p.sendMessage(getConfigString(plugin, "friends.already-requested"));
                        }
                    } else {
                        p.sendMessage(getConfigString(plugin, "friends.already-friends-message"));
                    }```
#

why does this cause so much lag

#

its on bungeecord

quaint mantle
sullen dome
#

well

#

thats the swimming state if i'm right

#

so check if he is swimming, and not in water.
then he is actually crawling

eternal night
quaint mantle
eternal night
#

EntityPoseChangeEvent might work ?

quaint mantle
#

I'll try that, thanks

dense goblet
#

is standard java serialisation unusable with spigot?

#

i.e. serialise to bytes, save as BYTE_ARRAY nbt, then deserialise

quiet ice
#

I do not recommend it at all

#

Java serialisation should never be used unless you have an idea what you are doing, but that would mean that you already know the answer to your question

dense goblet
#

I wanted to use it so I can take advantage of the transient keyword easily

quiet ice
#

One field added or removed and you have killed your savefiles

#

Especially stupid with obfuscated code

dense goblet
#

ok, how should I go about serialising and using default values in the case that a field is not specified

eternal oxide
#

what are you wanting to serialize?

dense goblet
#

a HouseInfo object, which contains a list of RoomInfos, and a RoomInfo contains two integers, a list of BlockPositions (int, short, int) and a set of BlockPositions

#
private int floorArea = 0;
private int beds = 0;
private final List<BlockPosition> possibleConnectedRooms = new ArrayList<>();
private final Set<BlockPosition> encounteredDoors = new HashSet<>();

^RoomInfo

eternal oxide
#

fairly basic, yes you can use java serialization, or depending on how you want to store them, Bukkit has its own serializer

dense goblet
#

I tried using java serialisation but I get a ClassNotFoundException for some reason

eternal oxide
#

is BlockPosition your own class?

dense goblet
#

yes

#

also Serializable

eternal oxide
#

you clearly did something wrong then

digital plinth
#

is there a way to lock the direction which a entity is traveling, like I want wither skulls to fly in a straight line. If you just launch it it will start to fly horizontally

dense goblet
#

not sure what I did wrong

#

I use SerializationUtils to serialise/deserialise

digital plinth
#

Both black and blue skulls curve upward, making it super hard to target mobs/players

#

does wither skulls count as

#

projectiles or entites

dense goblet
#

maybe it's due to the List and Set though

eternal oxide
#

ALL objects in a class must be serializable

dense goblet
#

for whatever reason I remembered that collections serialised fine

eternal oxide
#

are the objects in your Set and List serializable?

dense goblet
#

yes, all BlockPositions

quiet ice
#

wouldn't java throw a more specific error there?

dense goblet
#

is it because BlockPosition is a static final class inside another class?

dense goblet
quiet ice
#

static final is irrelevant for you

eternal oxide
#

The serializer has to be able to access the bytecode of the class

dense goblet
#

I don't see why it wouldn't, all saved classes are publicly accessible

quiet ice
#

On the bytecode layer it is pretty much irrelevant if the class is static or not while the final modifier just prevents you from extending the class, which is also irrelevant for you

dense goblet
#

thinking more that it being inside another class is the problem

quiet ice
#

nah

eternal oxide
#

Your error says it can;t access HouseInfo

dense goblet
#

which is really weird

quiet ice
#

Javac changes such classes to OuterClass$InnerClass, so you will not have any issues here

dense goblet
#
package kaktusz.kaktuszlogistics.modules.survival.world.housing;

import kaktusz.kaktuszlogistics.util.minecraft.VanillaUtils;
import kaktusz.kaktuszlogistics.world.KLWorld;
import org.bukkit.ChunkSnapshot;
import org.bukkit.World;

import java.io.Serializable;
import java.util.*;

public class HouseInfo implements Serializable {
    private static final long serialVersionUID = 100L;
[...]
quiet ice
#

Do you get any other stacktraces in your log?

#

I doubt it (given that is should throw an ClassDefNotFoundError in this case), but perhaps there is something wrong

dense goblet
unreal sandal
#

Hello, I can't remember, but how can I stop my algorithm ?

dense goblet
#

no other errors pop up, serialising goes fine

dense goblet
#

the byte arrays are the same when serialised and when recovered from NBT

eternal oxide
#

Two HouseInfo classes? I hope they have different Ids

unreal sandal
#

@quiet ice I don't understand

quiet ice
#

You see, "algorithm" is very unspecific

dense goblet
#

there shouldn't be two HouseInfo classes

tame coral
#

Is there anyway to get the direction a player is looking ?

dense goblet
#

where do you see that?

eternal oxide
#

nm, me misreading

unreal sandal
#

@quiet ice I would like to stop the execution of my command

sage swift
#

Bukkit.shutdown() should accomplish that

quiet ice
#

Easy route: throw new InternalException()

unreal sandal
#

@tame coral Donc je fais return true; comme c'est un boolean ?

dense goblet
tame coral
sage swift
unreal sandal
#

@tame coral D'accord merci

quiet ice
#

return false will print a message return true will return with nothing

unreal sandal
#

@quiet ice Okay thank you 🙂

sage swift
#

return croissant == null ? baguette : croissant;

tame coral
#

lul

dry beacon
#

When I try to register an event which has a constructor with plugin in it, the line shows up red with the error below. Here's my constructor and event listener:

getServer().getPluginManager().registerEvents(new JoinListener(this), this); // this is red```
```java
    public JoinListener(AutoTimeRank plugin) {

        public Plugin plugin;
        this.plugin = plugin;

    }
tame coral
#

I can't find anything in the docs

quiet ice
#

Get the vector of the player

sage swift
#

does JoinListener implement Listener

quiet ice
#

throw new <any exception>(); will also print a nice message

dry beacon
#

second time I've made this mistake, thanks gecko!

sage swift
#

also why is the plugin field defined in the constructor

#

it should be defined outside so it can be accessible in other methods

compact haven
#

dependency injection

#

oh

tame coral
sage swift
#

yeah

compact haven
#

you mean the field in the constructor

#

LMAO

#

didnt notice that

#

@dry beacon for dependency injection to have any use, the field needs to be declared outside of the constructor and the type should be the plugin's class, not just Plugin

#

like AutoTimeRank instead of Plugin or JavaPlugin

quiet ice
#

?jd

quiet ice
#

smh no https

chrome beacon
#

?

compact haven
#

you know how spigotmc has a search bar and all that in the javadocs

#

is there a 1.8.8 hosted version with that search bar n stuffs

quiet ice
# chrome beacon ?

Firefox prints a large "this site is doing unsafe https shit" error when clicking on the jd link

chrome beacon
#

Ah

dry beacon
sage swift
#

but yes

quiet ice
#
digital plinth
#

is a wither skull an entity

sage swift
#

yes

#

duh

#

what fuckin else would it be

digital plinth
#

okay lol

quiet ice
#

well, the block is not

sage swift
#

thats wither skeleton skull

quiet ice
#

I guess that is true

compact haven
#

theres no search bar on helpchat's javadocs :(

sage swift
#

so use 1.17

#

👍

compact haven
#

what

#

thats the most

#

what

tame coral
quiet ice
#

there is still the index

chrome beacon
quiet ice
#

but that is an issue with highly old java versions

dense goblet
#

is it a bad idea to register with ConfigurationSerialisable in a static code block

quiet ice
#

looks fishy, but if it works it works

compact haven
#

why would it be?

dense goblet
#

wondering if it would mess up when deserialising a class that hasn't been accessed yet

compact haven
#

well ConfigurationSerializable is probably already initialized

#

and the methods to serialize and deserialize arent called until its meant to be done

quiet ice
#

I mean, you can reference the same class inside the static block

compact haven
#

so I dont see how it wouldnt be initialized when called 🤷‍♂️

dense goblet
quiet ice
#

correct

#

Well, not really

#

The block executes once the class is loaded and initialized, which can also be done by the classloader or other external influences

dense goblet
#

so I don't need to worry that the block hasn't executed by the time I'm deserialising a byte array that may contain the class

quiet ice
#

I do not think that you need to - unless the serial lib uses stupid stuff

rocky glacier
#

so i used intellij for a plugin but it doesnt find STAINED_GLASS_PANE

quiet ice
#

version?

rocky glacier
#

or DOUBLE_PLANT

#

1.17

quiet ice
#

Use the deprecated LEGACY_STAINED_GLASS_PANE instead

stone sinew
quiet ice
#

and ignore the javadoc that tells you to NOT use it

stone sinew
dense goblet
#

using ConfigurationSerialisable, can I put a list or set as a value in the hashmap?

dusty sphinx
#

Are there any plugins / tools that could help test the performance of a server? I mean like vanilla MSPT.
Trying to see if a part of a plugin I'm working on has any performance impact

rocky glacier
#

how can i replace all STAINED_GLASS_PANE to BLACK_STAINED_GLASS_PANE

dusty sphinx
dense goblet
dusty sphinx
#

Well yeah, but I want something more quantifiable to an end user

dense goblet
dusty sphinx
#

MSPT of a server under load

#

a way to load the server

#

reading the mspt is fine

dense goblet
#

so you want to lag the server on purpose right

dusty sphinx
#

yes thats one way to put it

dense goblet
#

loading a lot of chunks is a good idea

#

getBlock all blocks in a large plane

#

or a cube if you want to push it

dusty sphinx
#

Ok, that might work

#

Nah loading/genning new chunks should slow down the server the way I want

dense goblet
#

just keep in mind new chunks will lag more than loading existing chunks so your test results may be inconsistent

dusty sphinx
#

hook into a multiworld plugin and create a new world :kek:

#

but then theres that overhead

clear galleon
#

how can you get the hardness of a block

dusty sphinx
#

Hmmmm

dense goblet
#

could try set block over a large area

#

like a plane of sand with each block set individually

dusty sphinx
#

On second thought loading the world might not work

rotund pond
dusty sphinx
#

Can you "make a server lag" with timings?

rotund pond
#

Ah sorry no

dusty sphinx
#

Here let me reword what I want

dense goblet
#

lots of pathfinding could do it too

shy wolf
#

?docs

#

?doc

#

help?

dusty sphinx
#

I am trying to test the MSPT of a certain server and a certain plugin under a known amount of load

dense goblet
#

?jd

shy wolf
#

ty

dusty sphinx
#

To measure performance and if the plugin/server software has any impact

dusty sphinx
dense goblet
#

idea:
choose a large area
every tick, set the y=0 layer to bedrock, set the y=1 and y=2 layers to air, kill all item entities and spawn falling sand entities at y=2

#

this should lag it quite a lot over say 128x128

dusty sphinx
#

Hmm

dense goblet
#

and the lag should be constant since items won't build up

dusty sphinx
#

cant i just set the vanilla gamerule dotiledrops false

dense goblet
#

you could also just sleep the main thread

#

but that is "synthetic" lag

dusty sphinx
#

yeah i was about to say

#

i want something that more realistically represents the server performance

#

pathfinding code might be on the right track but im not quite sure how to implement that

#

Oh well, just an opportunity to learn

dense goblet
#

you can do a DFS floodfill using getBlock

dusty sphinx
#

I have a better idea

#

Is there a way to make the server tick faster? Like tick warp in carpet

#

If all I want is the MSPT under a known amount of load I can just do that (if its possible) and then read the TPS

dense goblet
#

what type of load are you looking for

#

not sure if tick speed is modifiable in spigot

dusty sphinx
#

Just like

#

Load a plugin, let it do something

#

and then do that for x amount of ticks then see the results

dense goblet
#

and this "something" is the thing that should lag the server?

#

oh also explosions can get extremely laggy

dusty sphinx
#

Ill look around

dense goblet
#

not sure how optimised they are for empty areas though so if you go for explosions you might want to re-fill the area they destroy

#

can be done easily with an event listener which cancels the entity explode event

dusty sphinx
#

hmm

#

Is there a way to manually tick the entire server?

chrome beacon
#

Probably with some hacky NMD

#

I would recommend forking spigot instead of trying to do it with a plugin

dusty sphinx
#

I wanted to test on multiple pieces of server software

#

Maybe a patch would be best then, but I have no idea where to start

ebon isle
#

Hello, I try to go through lintellij hot-swap tutorial but I end up with this error

#
C:\Users\korut\.jdks\openjdk-16.0.1\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:61698,suspend=y,server=n -Dfile.encoding=windows-1252 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.1\lib\idea_rt.jar" -jar "C:\Users\korut\Desktop\ArmyRP - Local Server\spigot-1.16.5.jar"

Connected to the target VM, address: '127.0.0.1:61698', transport: 'socket'

Unsupported Java detected (60.0). Only up to Java 15 is supported.

Disconnected from the target VM, address: '127.0.0.1:61698', transport: 'socket'

Process finished with exit code 0```
#

When I run the debugger.

ivory sleet
#

Java 16 on a spigot 1.16.5 server won’t work

chrome beacon
#

It does

#

If you're up to date

ebon isle
#

This is my debug confg

chrome beacon
#

It's a special version of jdk 11 with better hotswapping support

ebon isle
chrome beacon
#

Also update your server it's out of date

ivory sleet
chrome beacon
#

Lol read the preview

ivory sleet
#

Oh yeah

ebon isle
#

Thanks @chrome beacon It's working.

#

Thanks also @ivory sleet

ivory sleet
#

Olivo is the real man (;

wraith rapids
#

i'm not seeing them on the roster

#

but, welcome to maninism, initiate

rocky glacier
#

Whats wrong here:
@EventHandler
public void onInvClick(final InventoryClickEvent event) {
if (event.getInventory().getName() != " Bitcoin Market") {
return;
}
if (event.getCurrentItem() != null) {

getName -> Cannot resolve 'getname' in 'Inventory'

chrome beacon
#

Well getName doesn't exist

rocky glacier
#

what should i take

chrome beacon
#

getTitle

rocky glacier
#

okay tx

chrome beacon
#

Also don't match inventories by name

rocky glacier
#

getTitle also doesnt work

sage swift
#

use that

chrome beacon
grand coral
#

How to get the Player teleported to spawn if He fall in void?

sage swift
#

what

#

oh

#

PlayerMoveEvent -> y < 0 -> player.teleport(spawn)

#

🤯

chrome beacon
sage swift
#

or use Bukkit.shutdown();

#

that will make it so the player doesn't die in the void 👍

rocky glacier
#

now it says Operator '!=' cannot be applied to 'org.bukkit.inventory.InventoryHolder', 'java.lang.String'

wraith rapids
#

learn java

rocky glacier
#

yh i started learning it but that small problem i need help

chrome beacon
#

?learnjava

undone axleBOT
wraith rapids
#

knowing java basics is a prerequisite for doing things with a java based server using a java based api

sage swift
#

clearly not

#

youre doing it

wraith rapids
#

i do a little bit of everything

#

including but not limited to your mom

sage swift
#

do me

rocky glacier
#

for that plugin this is the only error

tired nacelle
#

Hi i'm trying to make a simple plugin but after world loading the plugin throws
The embedded resource 'config.yml' cannot be found in plugins/NoKillSMP-1.0.0.jar and the issued line is line:22 which is saveDefaultConfig();

sage swift
#

do you have the config.yml

tired nacelle
#

yeah

sage swift
#

show your project structure

wraith rapids
#

is it actually in the jar

tired nacelle
#

can't attach the pic

sage swift
#

verify

#

kek

quaint mantle
#

How do i give people a speed 2 potion that lasts for 1:30 minutes

tired nacelle
quaint mantle
#

im not trying to get the potion effect, but the potion itself...

wraith rapids
#

you apply the potion effect to the potion

sage swift
#

no thats deprecated

wraith rapids
#

great

tired nacelle
#

@sage swift

wraith rapids
#

i'm not seeing a config.yml in resources

tired nacelle
#

idea made that file by default

wraith rapids
#

where is your config.yml

#

the config yml needs to be in the jar

#

and for that to happen, it needs to be in the resources directory

tired nacelle
#

i thought plugin.yml was the config (sorry this is my first plugin)

wraith rapids
#

config.yml is the config

wraith rapids
#

The embedded resource 'config.yml' cannot be found
the server told you it's config.yml

#

do you have the config.yml
gecko told you it's config.yml

opal juniper
#

If someone has an example for a entity moment + rotation packet I would appreciate it (protocollib ideally but nms 1.17 is fine)

#

Just @ me it

ivory sleet
#

I can look thru my mod, pretty sure I got one there

opal juniper
#

Ok - nice

ivory sleet
#

Oh nvm I will have to do it tmrw uh sry I failed you Jeff 😔

opal juniper
#

Lmao

#

It’s fine my man

quaint mantle
#

is it possible/does it causes any problem to use non-java librairies in our plugin minecraft coding ?

compact haven
#

sure lets use python libraries im sure it'll work with the jvm yeahhh h yeah sure

quaint mantle
#

right now the PlayerRiptideEvent cannot be cancelled for unknown reasons
whats the best way to "cancel" the event otherwise

quaint mantle
#

I meant non official java libraries

quiet hearth
#

Is there a way to make it so you cant place a block? I am trying to make a block (dirt) that opens an inventory on right click and dont want it to be placed.

quaint mantle
#

like java libraries but that have nothing to do with minecraft

wraith rapids
#

java is java

#

minecraft is built on top of libraries that have nothing to do with minecraft

quaint mantle
#

hmm okay I see

#

that's pretty dope

quaint mantle
#

that will cancel the block place

quiet hearth
#

Would that work in the event “PlayerInteracrEvent”

quaint mantle
#

it should

quiet hearth
#

Ok ty

quaint mantle
#

Is anyone familiar with Jackson Serialization. I'm a little confused with how to implement it into my plugin. I need to know how to Serialize a custom Class called customPlayer.java, which contains instances of other custom Classes.

ivory sleet
#

Jackson 😬😬

quaint mantle
#

Should I be using gson instead?

#

Or what would you suggest?

ivory sleet
#

Gson or simplejson

#

But please not Jackson lol

#

No nvm

#

Hi

quaint mantle
#

Lol. Stack Overflow suggested I used it

ivory sleet
#

Jk

#

Sry

#

I am brainwashed

#

Jsonsimple is the bad one

#

Sry my apologies

quaint mantle
#

ok ok

lusty vault
#

Hi, my server is being thread blocked, having near 500ms of lag according to timings when I try to read a YAML file in the join event on a 1.8 server on iSpigot on a Velocity network. I can just fix this by using async right?

ivory sleet
#

Yea use AsyncPlayerPreLoginEvent

#

Then just load it there

#

Never do io on server thread my guy

main dew
#

How I can change value final variable?

ivory sleet
#

Reflection, bytecode manipulation or unsafe

inland mulch
#

do i need to use JavaSE-16 as my execution enviornment JRE if im gonna make a 1.17 plugin

#

or do i still use JavaSE-8

#

1.8*

ivory sleet
#

Anyways @quaint mantle I am experienced in Gson so I can help you with that if it’s fine

#

No for development java 8 will work fine in most cases

inland mulch
#

alright

main dew
ivory sleet
#

Well Raymano give me more context

main dew
#

a oke I want change final ItemStack in spigot 1.17

wraith rapids
#

I can just fix this by using async right?
typical words spoken by 1.8 developers

quaint mantle
#

@ivory sleet Can I pm you?

main dew
#
private static Field invertModifiers(Field field, int... modifiers) throws NoSuchFieldException, IllegalAccessException {
        if (!field.isAccessible()) field.setAccessible(true);

        Field mod = Field.class.getDeclaredField("modifiers");


        if (!mod.isAccessible()) mod.setAccessible(true);

        for (final int modifier : modifiers) mod.setInt(field, field.getModifiers() & ~modifier);
        return field;
    }``` I try this code but don't work in java 16
sage swift
#

only i can pm him

wraith rapids
#

that is illegal

ivory sleet
#

Noaln why not here

#

@main dew might wanna try unsafe then

main dew
#

how?

ivory sleet
sage swift
#

no one is jealous of 1.8

#

trust me

proud basin
#

everyone is

ivory sleet
wraith rapids
#

i am jealous of a world where throwing async at shit solves all problems

sage swift
#

"oh no i dont get 3 features instead of 20"

main dew
proud basin
#

You see Conclure life is all about 1.8

ivory sleet
#

To be fair I like 1.16.5 more

main dew
#

I honestly don't care what version people program on

proud basin
#

Thank you Raymano

#

It's just a version

unreal quartz
#

until they come here and need a solution to something which can be easily solved by simply upgrading

wraith rapids
#

and nobody knows the answer to because to 1.8'ers ever answer questions and nobody else knows the answers

proud basin
#

You answer mine all the time

wraith rapids
#

your problems aren't usually 1.8 specific

#

except when they are, which is when I usually tell you to fuck off to 1.8 land

main dew
# ivory sleet https://www.baeldung.com/java-unsafe

I try this but I don't understand this you can help me? java Value value = new Value(); Field field = invertModifiers(value.getClass().getDeclaredField("a"), Modifier.FINAL); field.set(value, "abcd"); System.out.println(value.a);

proud basin
#

😦

main dew
main dew
#

I try change final variables

wraith rapids
#

you can't do that with unsafe easily either

main dew
#

this code only for test

paper viper
#

You can’t do it pretty much

wraith rapids
#

as unsafe requires you to get a Field object first to get its offset and shit

#

and java 16 doesn't let you get Field objects for private fields in propietary 'secure' classes

hexed hatch
#

Why are you trying to change a final variable

paper viper
#

^

main dew
paper viper
#

Then what the hell is your problem

#

What you are asking is an XY problem

undone axleBOT
paper viper
#

?xy

main dew
#

he wants to confuse the results of the recipes

wraith rapids
#

what

paper viper
#

?

wraith rapids
#

#1 what the fuck

#

#2 what does that have to do with final fields

main dew
#

random receptures output

quaint mantle
#

you don't touch the modifiers field anymore

#

you just use unsafe, it skips that part

main dew
#

he wants to change the final results of crafting to random

ivory sleet
#

The ItemStack thing wouldn’t solve it

wraith rapids
#

i guess I should change the lobotomizer timings integration to use unsafe instead of reflection

#

because apparently that is more fucking stable than using the actual api in java

quaint mantle
#

neither unsafe or reflection is really supported 🙂

wraith rapids
#

the only difference being is that reflection gets shat on and cucked and broken more with every new version

quaint mantle
#

Unsafe is slowly being phased out for official API options

paper viper
#

Unsafe isn’t any better tbh lol

ivory sleet
paper viper
#

Unsafe is what the name stands

wraith rapids
#

at least it doesn't break literally every version

paper viper
#

Ig

wraith rapids
#

based on experience reflection is more unsafe than unsafe

quaint mantle
#

not like reflection breaks every version

wraith rapids
#

it breaks more and more every version

ivory sleet
#

Why not

quaint mantle
#

they are slowly securing the internals of the JDK which breaks some dumb reflection stuff

#

but... its very slow...

wraith rapids
#

yeah

#

a little bit in every version slow

quaint mantle
#

If you need access to those internals you're suppose to request for API changes

wraith rapids
#

and then wait 20 years for them to be actually implemented and for my userbase to actually use that new version they were implemented in

#

until 1.17, java 1.8 was the most common version people used for minecraft servers

quaint mantle
#

well for minecraft, mojang should be forcing the latest version anyway

main dew
#

what do you think should use unsafe?

quaint mantle
#

but they'll prob stop at 1.17 cause they don't care

ivory sleet
#

ProMoRRom why async?

wraith rapids
#

so it'll only take 15 years instead of 20

ivory sleet
#

That would only hurt performance

wraith rapids
#

everything must be async

#

more async = more performance

ivory sleet
wraith rapids
#

@proud basin isn't that right, nose and chin man

ivory sleet
#

Run it as is

wraith rapids
#

it is safe to run async afaik

proud basin
#

What is right

main dew
#

@proud basin what you want to do?

wraith rapids
#

but you should not explicitly schedule it to be run async if you're in a sync context

quaint mantle
#

all playSound does is send a packet.. 0 reason to async it

proud basin
wraith rapids
#

but there is no need to schedule to sync if you're in an async context, either

ivory sleet
#

Prom if it’s in async context already then sure but don’t bother to just do it cause of the sake of it

paper viper
#

I used it asynchronous before and it doesn’t work for some reason

wraith rapids
#

do it in whatever context you are in

paper viper
#

I did it for my media plugin, asynchronous it’s weird

#

Like sometimes it works

#

Sometimes it doesn’t

main dew
ivory sleet
#

Did you try on every nms version pulse?

#

🤡

paper viper
#

Not yet

#

Lol

proud basin
main dew
#

what do you think should use unsafe?

proud basin
wraith rapids
#

you should use unsafe instead of reflection

main dew
proud basin
#

yes

main dew
#

I think yes

proud basin
#

How about the other one

wraith rapids
#

how tall are you, nose and chin man

#

did you put all of your points into the nose and chin in the character creation screen

proud basin
#

5'11

#

Wow rude

wraith rapids
#

it's a compliment

paper viper
#

That’s quite tall

#

6 feet is pretty good

#

Or almost

ivory sleet
#

Pulse how tall r u lol

paper viper
#

Like 5 foot 10

main dew
ivory sleet
#

CM?

#

cm

wraith rapids
#

just as dangeourus as reflection

paper viper
#

Inch

wraith rapids
#

nothing is dangeourus by itself

proud basin
#

just say 5'10

paper viper
#

Cause America dumb

ivory sleet
#

How many centimeters :0

paper viper
#

Well one inch is 2.54 cm

proud basin
#

actually its 2.55

main dew
ivory sleet
next stratus
#

I swear world edit needs a rework or atleast better documentation lol

wraith rapids
#

the issue with the documentation is precisely that

#

it's been reworked too many times

ivory sleet
#

I can smell api breaking changes

wraith rapids
#

all of the documentation and help discussions are for versions from like 2-3 reworks ago

paper viper
next stratus
#

I set it up to use fawe , but then it can't find the classes it needs

proud basin
paper viper
#

Nope

#

Remembered it for 5 years

#

I know what it is

#

You are spitting false info

#

Lol

next stratus
wraith rapids
#

working with worldedit or any other enginehub projects is pain

#

it always gives me a fucking aneurysm

proud basin
#

calculate the diameter for a triangle then in cm

next stratus
#

Dude I hit my head on the desk today using we

paper viper
#

Diameter of a triangle?

#

Lol

#

Perimeter

wraith rapids
#

yeah it's fucking unreal

next stratus
#

I also smashed the mouse on my head

#

That thing fucking hurt

wraith rapids
#

all of the documentation is either sparse, nonexistent, or outdated

next stratus
#

I forgot it was weighted as well lol

wraith rapids
#

same goes for all of the spigot threads

next stratus
#

So I smashed a weighted mouse into my head

wraith rapids
#

the best recourse is supposedly to go on their discord

#

apparently they help you there

next stratus
#

"help"

ivory sleet
#

Do they actually?

next stratus
#

Heh

wraith rapids
#

i don't know

#

i've been told so

next stratus
#

No they don't

proud basin
next stratus
#

I got more chance of md5 releasing spigot updates quicker than them helping

wraith rapids
#

how about getting rid of the material enum

ivory sleet
#

Replacing it with?

wraith rapids
#

or updating snakeyaml

ivory sleet
#

I believe that would break the Bukkit config api but yeah that would be nice

wraith rapids
#

an api is a promise

#

and promises are made to be broken

next stratus
#

I will likely reward someone who is able to help me with the fawe / worldedit api

wraith rapids
#

yeah no thanks

ivory sleet
#

I have used it once and it wasn’t the best experience but tbf it was reasonable

next stratus
#

I don't know why I'm putting myself through the pain

#

I don't know why they make it so hard to paste a fucking schematic

ivory sleet
#

Oh yeah that’s true

next stratus
#

It's the most basic thing ever but you gotta do 15 things to prepare it :|

wraith rapids
#

muh modularity

ivory sleet
#

SOLID purism

wraith rapids
#

i prefer KISS purism

#

keep it simple, stupid

ivory sleet
#

Feels like it’s been proven they don’t go hand in hand everytime

next stratus
#

The best part is I paid a certain user from this discord to make a plugin and now I gotta pay him more to get the thing updated lol

ivory sleet
#

🥴

next stratus
#

Even tho the code was broken at first

wraith rapids
#

you have been brainwashed by capitalist propaganda

main dew
#

how I can change ItemStack use UnSafe?

next stratus
wraith rapids
#

read the guide that was linked to you

main dew
#

this link?

wraith rapids
#

yes

#

or any other unsafe guide on the internet

#

i'm sure dung dung isn't the best

next stratus
#

Is the only way to paste schematics using fawe to go through the absolute pain and horrible process what's out there?

main dew
# wraith rapids or any other unsafe guide on the internet
        Value value = new Value();
        Field field = Unsafe.class.getDeclaredField("theUnsafe");
        field.setAccessible(true);
        Unsafe unsafe = (Unsafe) field.get(null);
        unsafe.putObject(value, unsafe.objectFieldOffset(value.getClass().getDeclaredField("a")), "abcd");
        System.out.println(value.a);``` I check this for test
#

and I have one problem how variables is final I can't change it

#

without error but it don't change

#

or now change 🤨

twilit nexus
#

howdy howdy

main dew
#

someone how after I use field

twilit nexus
#

would someone be able to help me when they get the time

oblique nymph
#

Hello there, is it possible to know if a player is actually using a spyglass?

twilit nexus
#

just a quick question about plugin development

twilit nexus
#

So I am trying to set up tab completion with strings but I don't know how

ivory sleet
twilit nexus
#

I want the tabCompletion to be able to show stuff like ping or hours

#

stuff like that

main dew
#

why does it not work at the start, how do I remove the final works and how do I restore the final works 🧐

oblique nymph
ivory sleet
#

Yeah true else we might have a new event making itself into the api

#

If it doesn’t already exist that is

oblique nymph
#

I don't think it does, at least the 1.17 update post in the forum doesn't say anything about that

glacial arch
#

How would I change the knockback of a mob? I'm making it so that when you get hit by a mob you get knocked back 1000 blocks. I tried to change the velocity of the player that got hit in EntityDamageByEntityEvent but that will only knock the player back in a certain direction so it could end up shooting the player forward or to the side.

twilit nexus
ivory sleet
oblique nymph
#

And multiply it until you get it to knock it 1000 blocks

oblique nymph
quaint mantle
twilit nexus
#

so I am making a plugin for a command on my server called /show and I want to set it up so that I can use getConfig.getStringList() to call strings

quaint mantle
#

okay.. so get the string list from the config and return it

twilit nexus
#

yea

quaint mantle
#

so what do you need help with then?

acoustic moon
#

hey, i'm trying to make a plugin that disables the elytra when a player takes damage from an entity. i already have a listener, i'm just not sure how to get the entity.Player from the Entity object returned when i do event.getEntity
this is what i have so far:

package io.github.fourinchknife.elycomtag.listeners;

import io.github.fourinchknife.elycomtag.ElyComTag;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.scoreboard.ScoreboardManager;

public class CombatTaggedListener implements Listener {
    private final ElyComTag plugin;
    private final ScoreboardManager scoreboardManager;
    public CombatTaggedListener(ElyComTag plugin) {
        this.plugin = plugin;
        this.scoreboardManager = plugin.getServer().getScoreboardManager();
    }
    @EventHandler
    public void onEntityDamaged(EntityDamageByEntityEvent event){
        Entity attacker = event.getDamager();
        Entity attacked = event.getEntity();
        if (attacked.getType() != EntityType.PLAYER /*|| attacker.getType() != EntityType.PLAYER*/) return;
        plugin.logger.info(attacked.getName()+" attacked by "+attacker.getName());
        
    }
}
glacial arch
acoustic moon
#

so just cast it to Player?

glacial arch
acoustic moon
#

that's stupidly easy

glacial arch
#

just make sure you check that its a player first

acoustic moon
#

thanks

acoustic moon
glacial arch
#

alright np

granite stirrup
#

@wraith rapids why would u want to use Unsafe

#

dont you get it its Unsafe you shouldnt use it

acoustic moon
# glacial arch just make sure you check that its a player first
package io.github.fourinchknife.elycomtag.listeners;

import io.github.fourinchknife.elycomtag.ElyComTag;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.scoreboard.ScoreboardManager;

public class CombatTaggedListener implements Listener {
    private final ElyComTag plugin;
    private final ScoreboardManager scoreboardManager;
    public CombatTaggedListener(ElyComTag plugin) {
        this.plugin = plugin;
        this.scoreboardManager = plugin.getServer().getScoreboardManager();
    }
    @EventHandler
    public void onEntityDamaged(EntityDamageByEntityEvent event){
        if (event.getEntity() instanceof Player){
            ((Player) event.getEntity()).setGliding(false);
        }
    }
}

i'll give this a shot. does anything look obviously wrong?

quaint mantle
#

besides the unused variables

#

looks fine

granite stirrup
quaint mantle
#

why did you ping me

granite stirrup
proud basin
#

sussy bakka

acoustic moon
#

it's going to be a combat tagging system

#

but it worked

#

turn's out it's kinda hard to hit yourself with a bow while elytraing

granite stirrup
quaint mantle
#

can you not

granite stirrup
#

wait is it possible to display different scoreboards to users?

proud basin
#

someones mad

granite stirrup
quaint mantle
#

i don't know

granite stirrup
#

cuz if it was

#

wouldnt it be possible in vanilla?

proud basin
#

it is

#

though

#

different teams

granite stirrup
#

i meant without having to assign players to different teams

#

actually it might be possible without since i seen some plugins do it i think

#

ima search for tutorials maybe

slim magnet
#

Hello, I have an invunerable endercrystal, when I spawn an explosion next to it it disappears, what do I do to prevent this

granite stirrup
#

¯_(ツ)_/¯

slim magnet
#

@granite stirrup whats that event?

granite stirrup
slim magnet
#

??

granite stirrup
#

yeah dont ask me

slim magnet
#

smh

slim magnet
#

@quaint mantle Arent those for blocks?

#

EnderCrystal is an entity

#

is there an event for when an entity gets removed

quaint mantle
slim magnet
#

hmm

quiet hearth
#

import me.Chewie.BubbleItems.items.CustomItems;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;

public class OnRightClickMobEgg implements Listener {

    @EventHandler
    public static void onPlayerRightClick(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (player.getInventory().getItemInMainHand().getItemMeta() == CustomItems.giantSpawnEgg.getItemMeta()) {
                Location location = player.getLocation();
                player.getWorld().spawnEntity(location, EntityType.GIANT);
                player.sendMessage(ChatColor.DARK_GREEN + "That is one big zombie!");

            }
        }
    }
}

Im trying to have a custom zombie egg spawn a giant zombie rather than a small one, but it just spawns a regular one.. Not sure what i need to change to make that work

sullen dome
#

i was finally able to make my gui movement working properly ahhhhhhhhh

#

i'm dead rn

#

no clue what this actually does, but it works.. fuck my life

sullen dome
quiet hearth
#

no

#

just meta

sullen dome
#

then thats your issue probably

quiet hearth
#

ok

sullen dome
#

check out SpawnEggMeta#setSpawnedType()

quiet hearth
#

ok

granite stirrup
#

i believe

quaint mantle
#

and for blocks, which end crystal is not

rigid otter
#

YamlConfiguration.get() get object is suck

granite stirrup
rigid otter
granite stirrup
#

tnt is a entity

quaint mantle
sullen dome
#

you can disable the EntityDespawnEvent (Or DeathEvent, idk if an endcrystal is handled under death or despawn) and cancel it if the last damagesource was explosion i guess

quaint mantle
#

theres no EntityDespawnEvent in the javadocs

#

EntityDeathEvent is tho

#

it says LivingEntity, but endercrystals arent living entities

sullen dome
#

whats with EntityDamageEvent?

#

idk if cancelling that cancels the despawn/kill

#

and actually btw, there are indeed Block explosions

granite stirrup
sullen dome
#

respawn anchor for example.. or that other nether thing that explodes in wrong dimension, idk

#

or bed maybe? idk if bed is an entity tho

quaint mantle
#

javadoc bot when?

granite stirrup
#

make it @quaint mantle

#

and try and see if u can get spigot to use it

quaint mantle
#

bet

dapper steppe
#

i need some help, anyone up for the task?

quaint mantle
#

?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.

sullen dome
#

it's hard that that command has to exist lmao

granite stirrup
dapper steppe
#

sorry, new to this server

sullen dome
#

thats not only on this server lol

#

never ask somebody if you can ask something
just ask.

quaint mantle
#

lol

dapper steppe
#

the plugin on my bukkit server is not being loaded

sullen dome
#

you got an error?

granite stirrup
sullen dome
granite stirrup
#

also do you mean craftbukkit

#

bukkit is like at 1.7.2

#

XD

dapper steppe
#

not even an error, it just says that there is no plugins

sullen dome
#

check your console log

#

logs/latest.log, and paste it in here

granite stirrup
#

it could contain a ip

sullen dome
#

(but make sure to remove ip's of players or stuff, if present)

#

^

quaint mantle
#

?paste

undone axleBOT
sullen dome
#

i wasn't fast enough

granite stirrup
#

i mean no one here would ddos

#

but just in case

ivory sleet
#

Don’t be so sure

#

People here are lurking

sullen dome
#

also, no one literally uses his real ip in the server.properties. bc there's no reason for it

#

wellllll

#

there are probably some people who just wait for ip-exposure

sullen dome
#

why would you do that

#

just use localhost lmao

granite stirrup
sullen dome
#

lol

granite stirrup
#

but it works without it now

#

so i dont do it anymore

#

XD

dapper steppe
#

what should I be looking for in my log file?

sullen dome
#

just paste everything at:

#

?paste

undone axleBOT
sullen dome
#

or just drag the file into here, if you don't leak anything at all

#

nvm youre not verified. idk if you can link files

dapper steppe
#

?paste

undone axleBOT
granite stirrup
#

yeah you need to be verified to do it

#

@sullen dome plugin ideas?

sullen dome
#

not really

granite stirrup
#

f

#

i want some plugin ideas

sullen dome
#

make a client for 1.16/1.17 😰

dapper steppe
#

it might take a while to edit my name and ip out

sullen dome
#

one sec

#

ill show you what you search for

granite stirrup
quiet hearth
# sullen dome check out SpawnEggMeta#setSpawnedType()
        ItemStack item = new ItemStack(Material.ZOMBIE_SPAWN_EGG);
        SpawnEggMeta spawneggmeta = (SpawnEggMeta) item.getItemMeta();
        ItemMeta meta = item.getItemMeta();
        spawneggmeta.setSpawnedType(EntityType.GIANT);
        meta.setDisplayName(ChatColor.GREEN + "Giant Zombie");
        meta.addEnchant(Enchantment.LUCK, 1, false);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        ArrayList<String> lore = new ArrayList<>();
        lore.add(ChatColor.WHITE + "Spawns Giant Zombie!");
        lore.add("");
        //lore.add(TIER2);
        lore.add(UNFINISHED);
        meta.setLore(lore);
        item.setItemMeta(meta);
        item.setItemMeta(spawneggmeta);
        giantSpawnEgg = item;
}

I did this and says its out of date as an error

sullen dome
#

something that looks nearly like this

#

its pretty good to see tho

granite stirrup
#

can you pass things as references in java?

dapper steppe
#

found it!

#

Could not load 'plugins\CreeperSpawn.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type
at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:969) ~[craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:240) ~[craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:163) ~[craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:138) [craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadPlugins(CraftServer.java:349) [craftbukkit.jar:git-Bukkit-8160e29]
at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:197) [craftbukkit.jar:git-Bukkit-8160e29]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:762) [craftbukkit.jar:git-Bukkit-8160e29]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:948) ~[craftbukkit.jar:git-Bukkit-8160e29]
... 7 more

sullen dome
#

wtf

#

who made that plugin if i gonna ask

#

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
this doesn't look like a simple bug for me at all. lol

dapper steppe
#

what does that mean?

dusty herald
#

It means the developer tried to cast a String as a Map

sullen dome
#

if you made the plugin: you cannot cast a map to a string

#

or other side?

#

idk

dapper steppe
#

oh

#

uhhhh

#

how do you fix that(i'm new to coding MC plugins)

dusty herald
#

show code

sullen dome
#

^

#

maybe it would be good to see what are 7 more in that error

quiet hearth
#
        ItemStack item = new ItemStack(Material.ZOMBIE_SPAWN_EGG);
        SpawnEggMeta spawneggmeta = (SpawnEggMeta) item.getItemMeta();
        ItemMeta meta = item.getItemMeta();
        spawneggmeta.setSpawnedType(EntityType.GIANT);
        meta.setDisplayName(ChatColor.GREEN + "Giant Zombie");
        meta.addEnchant(Enchantment.LUCK, 1, false);
        meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
        ArrayList<String> lore = new ArrayList<>();
        lore.add(ChatColor.WHITE + "Spawns Giant Zombie!");
        lore.add("");
        //lore.add(TIER2);
        lore.add(UNFINISHED);
        meta.setLore(lore);
        item.setItemMeta(meta);
        item.setItemMeta(spawneggmeta);
        giantSpawnEgg = item;
}

is this wrong

sullen dome
#

god

#

please use ?paste in future for large code

quiet hearth
#

ok

quaint mantle
#

?paste

undone axleBOT
sullen dome
#

ill fix

#

nvm he deleted

dusty herald
#

show plugin.yml

dapper steppe
#

name: CreeperSpawn
version: 1.0
author: Jack
main: me.Jack.CreeperSpawn.Main
description: Spawns 10 creepers on player

commands:
creepspawn:
aliases: [cs]
description: /cs spawns 10 creepers on player

quaint mantle
#

and please use codeblocks

#

it helps us all when viewing other peoples code