#help-development

1 messages · Page 1922 of 1

hollow sand
#

discord

grim ice
#

o

#

is it a discord server, if so pls send i need moni for kidney kthx

onyx fjord
#

Never heard of that one

quaint mantle
#

You cannot mock Bukkit

grim ice
#

(i dont btw)

dusk flicker
#

what?

quaint mantle
#

You cannot mock static methods from Bukkit class

hollow sand
#

if u help me with spigot dev hehehe

dusk flicker
#

I'm not

#

I'm saying passing a server object through DI is useless

hollow sand
#

@grim ice I got a few

#

want 1 or 2

grim ice
#

2 ig

#

luv u :)

quaint mantle
hollow sand
#

a n y w a y s

#

how would I spawn the particles

kind hatch
#

Do you want to show them to everyone or only to a specific player?

kind hatch
#

Both the Player and World class share a method called #spawnParticle(); If you want to show them to everyone, use World#spawnParticle() otherwise use Player#spawnParticle().

The methods have parameters for location and offsets. So use the location for the math.

hollow sand
#

aha

#

How would I spawn the particles

#

on a projectile tho

kind hatch
#

Get the location of the projectile and spawn particles at that location. Since it will be moving, a trail will be created if you are using the scheduler for spawning the particles.

hollow sand
#

ok

#

lemme code it up and u'll check it

#

k?

#

since I'm no coding expert so idk xd

tepid crater
#

specialsource-maven-plugin problem

kind hatch
#

Still need help with this.

red sedge
#

How can I get the rotation the block was placed in

#

in a blockplaceevent

chrome beacon
ancient jackal
#

the head you're getting is null

chrome beacon
gleaming zenith
#

Thats the last leave, i need the last join…

kind hatch
ancient jackal
kind hatch
chrome beacon
#

The part where the error is

kind hatch
#

That's what I'm trying to figure out.

gleaming zenith
#

Thats the last leave, i need the last join…

chrome beacon
#

Preferably the entire method

kind hatch
#

The error says it's something to do with my IconSet.getNext method, but the NPE points to a custom head issue as it's NBTTagCompound.

#

But 1 sec, I'll post some stuff.

chrome beacon
#

I have to get some sleep now. If you can't solve it create a thread and I can help more tomorrow

karmic grove
#
    public void EntityDamageByEntityEvent (EntityDamageByEntityEvent event) {
        Entity e = event.getDamager();``` how can i tell if the eventdamager is a player
kind hatch
kind hatch
karmic grove
kind hatch
karmic grove
#

its hard to explain

kind hatch
#

You need to cast.

loud haven
#

if damager is an instanceof Player, then cast damager to Player

kind hatch
#

Player player = (Player) event.getDamager();

#

After you check if it's an instanceof a player.

karmic grove
#

oooohhh

kind hatch
low temple
karmic grove
#

i did ty

#

for warning

olive lance
olive lance
#

Why not if it is the same across all instances

#

i just realized ive been stopping the claim at 0 also

karmic grove
#

so i have this ```java
@EventHandler
public void EntityDamageByEntityEvent (EntityDamageByEntityEvent event) {
Entity en = event.getDamager();
if (en instanceof Player){
Player player = (Player) event.getDamager();

        if (TeamManager.isUndead(player) && !MorphManager.isPetNearOwner(player)) {
            event.setCancelled(true);

        }
    }``` but how do i tell if the entity getting damaged is an item frame
quaint mantle
#

There's a principle called depenency injection

karmic grove
#

so the entity damaged by entity only cancels the event if it got item in the item frame how can i bypass that

#

also did this change recently

bright jasper
#

Finally got that shit working

#

Now my tables are annotation powered with automatic migrations

#

vibing

left swift
#

How can I disable armor from falling out of entity?

quaint mantle
#

Are you doing an ORM

bright jasper
#

I used ebean which has migration generation and annotation table stuff. Took forever to get to work with spigot though

#

Weird class loader issues

#

Example ```java
@Entity
@Table(name = "players")
public class PlayerInfo extends Model {
public static PlayerInfoFinder find = new PlayerInfoFinder();

@Id
long id;

@NotNull
@Column(unique = true)
@DbComment("Mojang assigned UUID")
public UUID uuid;

@NotNull
@DbComment("Weather the user has verified their discord account linkage")
public boolean verified = false;

@NotNull
@Column(unique = true)
@DbComment("Discord snowflake ID")
public String discordId;

@Unique
@DbComment("ID of the discord message sent during verification")
public String verificationMessageId;

public PlayerInfo(
        @org.jetbrains.annotations.NotNull UUID uuid,
        @org.jetbrains.annotations.NotNull String discordId,
        @org.jetbrains.annotations.NotNull String verificationMessageId) {
    this.uuid = uuid;
    this.discordId = discordId;
    this.verificationMessageId = verificationMessageId;
}

public PlayerInfo setVerified(boolean verified) {
    this.verified = verified;
    return this;
}

}

#

You can get it with PlayerInfo.find.byUuidOptional(uuid)

quaint mantle
#

doesnt this do a synchronous database query?

#

Also static meh

bright jasper
#

The static is due to a finder. Its basically just```java
public class PlayerInfoFinder extends Finder<Long, PlayerInfo> {
public PlayerInfoFinder() {
super(PlayerInfo.class);
}

public Optional<PlayerInfo> byUuidOptional(UUID uuid) {
    return query()
            .where()
            .eq("uuid", uuid)
            .findOneOrEmpty();
}

public Optional<PlayerInfo> byDiscordIdOptional(String discordId) {
    return query()
            .where()
            .eq("discord_id", discordId)
            .findOneOrEmpty();
}

}

#

It depends on the current default database entered in the thread/classpath

quaint mantle
#

still, global variables

bright jasper
#

so? Who cares about globals. If you dont abuse the fuck out of them then its fine

#

Also it support futures for async. ill prob convert to future based later

quaint mantle
bright jasper
#

Yes, ive used C++, C#, Java, Rust, and Kotlin before. All of them are object oriented (except maybe Rust)

#

OOP is fine but not everything needs to be a scoped instance like that

#

Global instances are fine and it depends on how you use it

#

If you are setting random stuff as global then it becomes a problem. If you are setting a logger or a finder as global then its fine

#

Thats the rule with OOP

#

Just because people say global variables are bad doesnt mean they are bad all the time. Global variables should be used in a way that doesnt over complexify your code and keeps it still running mostly instanced

#

In 90% of situations globals are bad but this code would be much more disgusting if i was to use instances

#

Nor does it overcomplexify anything or make a forever dependency

quaint mantle
#

People say that they're bad for a reasons

bright jasper
#

People say they are bad but those people don't know what they are talking about. Globals are bad most of the time but there are good uses

#

Just because a professor or teacher who learned Java when it first came out in the 90s says its bad doesnt mean they are bad. It just means they are outdated

quaint mantle
#

I mean, okay, logger. Anything else?

bright jasper
#

This case is specifically fine. It's known as thread local design. What the finder does is find an instance/connection only available on your current thread and uses it

#

Thread local design is like a global but its different depending on the thread

#

Which means if you spawn another thead and try to access the database it will be null unless you enter the database in that other thread

#

Actually this is threadlocal AND classpath global

#

so only in my plugin will the instance be valid, this prevents conflicts with other plugins using ebean

quaint mantle
#
  1. Singleton violates SRP (Single Responsibility Principle) - the singleton class, in addition to actual responsibilites, also controls the number of its instances.
  2. Global state. When we access an instance of a class, we do not know the current state of that class, and who changed it and when, and this state may not be what is expected at all. In other words, the correctness of working with a singleton depends on the order of calls to it, which causes implicit dependence of subsystems on each other and, as a result, seriously complicates development.
  3. The dependency of class to singleton is not visible in the public contract. Since usually singleton is not passed in the method parameters, but is obtained directly, via GetInstance(), then to identify the class's dependence on the singleton, you need to get into the body of each method - just viewing the object's public contract is not enough.
  4. Singletones makes testing harder. If class depends on Singleton, you cannot easliy mock it.

This is not about the singletones only, but generally speaking about global variables.

bright jasper
#

not always true

#

depends on if you use singletons correctly or incorrectly

#

A DB is a connection with methods on it. You aren't modifying the state in the same way as a global static string

quaint mantle
#

i disagree. That does not specificslly mean the jaba object state. Database itself has state too

bright jasper
#

a private state

#

Plus, its thread local. you dont directly access the database, you do it through finder implementations

ivory sleet
#

Idk if it actually violates SRP, considering that SRP just states a class should have one major reason to change. So it merely depends on what we define as major xd

bright jasper
#

The way it works is classes like these

#
public class PlayerInfoFinder extends Finder<Long, PlayerInfo> {
    public PlayerInfoFinder() {
        super(PlayerInfo.class);
    }

    public Optional<PlayerInfo> byUuidOptional(UUID uuid) {
        return query()
                .where()
                .eq("uuid", uuid)
                .findOneOrEmpty();
    }

    public Optional<PlayerInfo> byDiscordIdOptional(String discordId) {
        return query()
                .where()
                .eq("discord_id", discordId)
                .findOneOrEmpty();
    }
}

query() initializes a query with the current thread and calling classpath database instance

#

there is a global manager that keeps track of instances depending on thread and classpath that runs the query on the proper context connection

#

In this case its fine.

quaint mantle
#

still implicit dependence

bright jasper
#

so? not like anyone is going to use it wrong

#

Just because an opinionated textbook says you cant do that doesnt mean its right

#

On top of that you arent using multiple databases in your program at the same time

#

Even if you are (in case of plugins) its thread/classpath based

ivory sleet
#

The main issue in my point of view is testability

#

Let’s say you setup a unit test

#

Most likely you might need sth like mockito and power mocks

#

Which is just sloppy to every extent

bright jasper
#

Initialize the database and set it as the context database for thread. Then do DB operations in test

ivory sleet
#

well, PlayerInfoFinder won't be the issue

#

but components that depend on it

twilit arch
#

Can you now write plugins in c# or some shit? Someone told me you can now in javascript and c# etc.

ivory sleet
#

as you'll for instance have old state repurposed into every test that gets instantiated

#

so then you're not just testing the unit

bright jasper
#

True, but you only have one database usually. Code portability is one thing but you need to copy the entire database class just to use it and then pass it in.

static ingot
ivory sleet
#

yeah riku tru

#

if you dont unit test this is not an issue anyhow

blazing scarab
#

fuck

bright jasper
#

Plus you could just drop the old state and start the new state, connect to an in memory h2 instance for tests

blazing scarab
#

you know commas exist

twilit arch
static ingot
#

I don't know any myself.

blazing scarab
static ingot
#

and I dunno about plugins specifically, but I should note I'm referring to the server software

#

which may or may not be helpful, lol

twilit arch
#

yeah i want to write server plugins

ivory sleet
twilit arch
#

in those languages

blazing scarab
#

you know who needs dis dumb tests anyways cuz just start the server

ivory sleet
#

ye

#

lets manually test everytime

granite burrow
#

how can I remove all leads attatched to a player?

bright jasper
#

.save is what inserts

ivory sleet
#

not what I meant rly

#

lets say some other class depend on your singleton

bright jasper
#

ah true, I mean with ebean you can also have multiple named instances

#

that you can either pass by instance or get by name

ivory sleet
#

yeah

bright jasper
#

If your doing tests that is useful

ivory sleet
#

tho I believe this entire discussion is kinda nitpicky

#

lol

#

ye

bright jasper
#

yeah true

#

its a weird case

ivory sleet
#

indeed

ancient jackal
#

how do I reduce the durability of an item by more than 1 when an event is called?

vocal cloud
#

By removing more durability from the item?

#

?jd

ancient jackal
#

it doesn't save at the end of the listener

waxen plinth
#

Wait a tick

#
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
  // your logic here
};```
vocal cloud
#

Are you making sure you're putting the meta back into the item?

waxen plinth
#

Otherwise your change is likely being overwritten by the result of the event

#

That too

vocal cloud
#

Or set the listener to monitor mode which runs after the event fires

waxen plinth
#

No it doesn't lol

vocal cloud
#

Doesn't it?

waxen plinth
#

You can cancel an event in the monitor phase, you're just not supposed to

vocal cloud
ancient jackal
#
public void applyDamage(ItemStack item, int damage) {
        ItemMeta itemMeta = item.getItemMeta();
        Damageable itemDamageMeta = (Damageable) itemMeta;
        int currentItemDamage = itemDamageMeta.getDamage();
        itemDamageMeta.setDamage(currentItemDamage + damage);
        item.setItemMeta(itemMeta);
    }```
waxen plinth
#

Yeah delay it

#

That should work

vocal cloud
#

Huh I guess I gotta go test monitor mode again cause maybe it's messing some of my stuff up lmfao

waxen plinth
#

Makes a lambda

#

You're passing a Runnable

#

Runnable is a functional interface - an interface which only defines one abstract method

#

So you can do

#
Runnable run = () -> {
  //stuff here
};```
#

And it's the same as

#
Runnable run = new Runnable() {

  @Override
  public void run() {
    //stuff here
  }

};```
#

But it's much shorter so you should pretty much always use the lambda syntax when possible

ancient jackal
#

oh neat, I'll look into that more

ivory sleet
#

yup

#

arguably one of the best language features 😄

ancient jackal
#

still not working java public void applyDamage(ItemStack item, int damage) { Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> { ItemMeta itemMeta = item.getItemMeta(); Damageable itemDamageMeta = (Damageable) itemMeta; int currentItemDamage = itemDamageMeta.getDamage(); itemDamageMeta.setDamage(currentItemDamage + damage); item.setItemMeta(itemMeta); }); }

sterile token
#

Why its not possible to add a Custom player (implements Player interface) to player list?

vocal cloud
kind hatch
#

Weird NPE

ancient jackal
# vocal cloud Maybe I'm blind but I don't see you adding the delay?
    public void applyDamage(ItemStack item, int damage) {
        Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> {
            ItemMeta itemMeta = item.getItemMeta();
            Damageable itemDamageMeta = (Damageable) itemMeta;
            int currentItemDamage = itemDamageMeta.getDamage();
            itemDamageMeta.setDamage(currentItemDamage + damage);
            item.setItemMeta(itemMeta);
        }, 2);
    }```
#

added delay, tried 1 and 2

#

unless delay is in seconds

#

where it would need to be 4

vocal cloud
#

It's tick based

#

So 20 = 1s

sterile token
#

Its telling me that im providing CustomPlayer. But that interface its extending Player. So i have no clues :/

vocal cloud
vocal cloud
sterile token
#

Any idea so?

vocal cloud
#

You need to use NMS cause even if you got it to work you'd need to update the clients to know, which is NMS

sterile token
#

I dont want the other player see this custom player

#

Its only to add a fake player to server. So plugin message detect it as online player

#

Im still trying to find a trick for using plugin message without real players onlines

sterile token
ancient jackal
sterile token
vocal cloud
dusk flicker
#

they just explained it

sterile token
#

I only need to bungee detect it as online player

vocal cloud
#

Because I imagine the issue is more deep rooted than that

dusk flicker
#

?xy

undone axleBOT
vocal cloud
#

I'll take a look later for you

sterile token
vocal cloud
#

Currently looking at @ancient jackal problem right now

sterile token
#

Allright

#

I will wait so

dusk flicker
#

read the bot output

sterile token
#

I dont udnerstand the message

dusk flicker
#

you are asking why something wont work, rather than what the actual problem is

sterile token
#

Im only trying to find a way of adding a fake player to server. So spigot detect it online. And allow me to received and send plugin messages

dusk flicker
#

Not going to be that simple

sterile token
#

Oh

dusk flicker
#

Def would be working with NMS

sterile token
#

def?

#

dont understand that words

loud haven
#

definitely*

sterile token
#

So definitly working over Netty will be my best alternative

dusk flicker
#

Depends on what you are trying to do

ancient jackal
#

delay of 40 not working either

sterile token
#

Thanks i wont lost more time trying to use that, that its not created for sending and receiving cross server messages (talking about plugin message channel)

dusk flicker
#

Theres multiple other ways of doing stuff like that, such as redis, as you mentioned netty, I would personally go for Redis but thats up to you

vocal cloud
sterile token
#

They have paid me for a core that they want to be independent from using Sockets and message brokers (Redis, RabbitMq, etc)

dusk flicker
#

yikes

#

Thats a mess

sterile token
#

Yeah

vocal cloud
#

lol we have this convo every day now it seems

dusk flicker
#

no reason you should have accepted that lmao

sterile token
#

And their arguments are that for doing that "they need extra resources"

sterile token
buoyant viper
#

they should've had the resources they needed ready

dusk flicker
#

fair enough, I feel like thats a bit low for a server core but its all depending on features

sterile token
#

🤡

#

They are exactly that emoji

rancid hare
#

Please help me

How can I check with .hasPermission() ingnoring ops?

#

(ignoring * permission too)

vocal cloud
#

if has !perm || isop

rancid hare
#

So I wanna check if someone has EXACTLY that permission

#

No the problem is that even if a player doesn't has that permission and he is op, it'll return true

vocal cloud
#

Ops get all permissions so the simple easy solution here is to not hand out op status like free candy

dusk flicker
#

^

rancid hare
#

Hmm

#
permissions:
  oranks.owner:
    default: false```
This is exactly what I want
#

But I want it not to only be oranks.owner but oranks.* so for every sub permission

ancient jackal
#

I guess the next best step would be to completely forget about this shearing plugin because item damage just does not work lol

rancid hare
#

What?

vocal cloud
ancient jackal
#

no matter the delay, goes down by only 1

vocal cloud
#

Cause your code works for me

ancient jackal
#

with shears on sheep?

vocal cloud
#

Let me try

ancient jackal
#

do you want to try my plugin? the compiled jar?

buoyant viper
#

kar.

dry forum
#

i want to display text above a players name, for example "Level 1" how would i do that? the only thing i can think of is have a named armor stand follow the player but not sure if thats the best way to do it

tender shard
#

you can use team prefixes if you're fine with using the same line

dry forum
#

do you know of any apis that make it easier?

tender shard
#

maybe you could also make the armorstand a passenger of the player, have you tried that?

waxen plinth
#

You should probably be doing that

#

Or if you are, you're not showing it to us

wary harness
#

So I am calculating players which are in range of player A in radious of 40 blocks
and doing that for every player do get there players in range.
So currently I have runnable task for every player which is doing that every 5 ticks.
I am curious is it ok to have that many runnable repeting task or should I just make code in runnable as method and for loop thru all player and do it in one runnable?

dry forum
waxen plinth
#

But having it be one task keeps it simpler

tender shard
dry forum
#

but the other things?

tender shard
#

if you loop through all players anyway, no need for 30+ runnables

wary harness
tender shard
wary harness
#

because they will fall of in water and player will not be alble to teleport

ancient jackal
# waxen plinth You're not setting the item in the inventory
// Collects animal info
        Entity originalAnimal = event.getEntity();
        Location animalLocation = originalAnimal.getLocation();
        // Collects player info
        Player player = event.getPlayer();
        Location playerLocation = player.getLocation();
        ItemStack usedShears = event.getItem();```
```java
 int damageToApply = 0;
        for (Entity animal : nearbyEntities) {
            // some stuff
            System.out.println("shearing sheep");
            damageToApply++;```
```java
onEventAlready = false;
        applyDamage(usedShears, damageToApply);
        System.out.println("Shears have " + ((Damageable) Objects.requireNonNull(usedShears.getItemMeta())).getDamage());
        System.out.println("Listener ended.");
    }```
dry forum
#

you can set gravity to false

wary harness
#

and dismount event is buggy

#

so u can't cancle it

#

plus there is no way to detect when teleport method is called to dismount passenger

ancient jackal
#

I call applyDamage with usedShears which references event.getItem

wary harness
#

and that will block you to teleport

#

so all essentials commands for tp will not work

vocal cloud
wary harness
#

with passneger on your head

ancient jackal
#

?paste

undone axleBOT
vocal cloud
#
    @EventHandler(priority = EventPriority.MONITOR)
    public void onItemDamageEvent(PlayerItemDamageEvent event) {
        ItemStack itemStack = event.getItem();
        applyDamage(itemStack,5000);
    }

    public void applyDamage(ItemStack item, int damage) {
        ItemMeta itemMeta = item.getItemMeta();
        Damageable itemDamageMeta = (Damageable) itemMeta;
        int currentItemDamage = itemDamageMeta.getDamage();
        itemDamageMeta.setDamage(currentItemDamage + damage);
        item.setItemMeta(itemMeta);
    }
ancient jackal
wary harness
dry forum
#

but is there a way to add offset to the armorstand

wary harness
#

you can use snow balls

dry forum
#

then that wont work for me

wary harness
#

as entity

dry forum
#

what

wary harness
#

insted of armorstand set snowball as passenger

tender shard
#

IIRC TAB has the ability to add new lines above a player head

#

so check out TAB's source code

dry forum
#

snowballs fall

wary harness
#

disable gravity

tender shard
#

grevvitee

wary harness
#

and change there material to air

#

and stack them on top of each other

dry forum
#

that wouldnt help though because i still cant add offset

tender shard
wary harness
#

around

#

I was looking in to it before

#

but not sure how they do it

dry forum
#

ig ill need to do that then

sterile token
#

Do you agree using that order for sending and receiving packets?

vocal cloud
vocal cloud
ancient jackal
#

I'm beyond confusion

vocal cloud
#

Yeah I can't replicate your issue to be honest

ancient jackal
#

can you send me the jar you compiled?

sterile token
vocal cloud
ancient jackal
#

maybe something broke between 1.18 and 1.18.1

vocal cloud
#

Nope. Explain how this is supposed to work

sterile token
vocal cloud
sterile token
#

Oh ok

#

Sorry

vocal cloud
# sterile token Oh ok

I'll take a look when I get the chance. I don't have a bungee test environment either atm

ancient jackal
#

The listener gets the player shears sheep event

#

if the event is already running, just return to prevent a large shear chain

#

get the event entity and event player, the animal location and the used shears ItemStack

sterile token
ancient jackal
#

and save that good stuff to variables

#

collects a list of nearby entities in a 3x3x3 block radius from the sheared sheep

vocal cloud
#

Yeah I copy pasted your code and it works just fine

ancient jackal
#

loops through and if it's not a sheep or is the original sheep you sheared, continue

#

otherwise it applies 1 damage each iteration just like you were shearing sheep 1 by 1

#

at the end, set onEventAlready to false so the listener can run it's stuff again

ancient jackal
#

just doesn't work at all for me lol

#

painful lol

tender shard
#

well then it sucks

errant bobcat
#

hello guy

vocal cloud
#

?nohello

errant bobcat
#

I can not use 2 Java on my server, for example Java 8 and Java 17, but in the flag I specify which Java I want to run the server on?

#

i can?

vocal cloud
#

You can choose what version of java to run by either setting the environment variable or using the path to the java install

young knoll
#

Use the full path to java in place of java in your start command

vocal cloud
errant bobcat
#

How to specify which java should server use on launch?

tender shard
vocal cloud
#

spray Unix

tender shard
#
mfnal@J▒germeister MINGW64 ~/IdeaProjects
$ cat ~/.bash_aliases
alias java8='/c/Program\ Files/Java/jdk1.8*/bin/java.exe'
alias java11='/c/Program\ Files/Java/jdk-11*/bin/java.exe'
alias java14='/c/Program\ Files/Java/jdk-14*/bin/java.exe'
alias java16='/c/Program\ Files/Java/jdk-16*/bin/java.exe'
alias java17='/c/Program\ Files/Java/jdk-17*/bin/java.exe'
alias java='/c/Program\ Files/Java/jdk-16*/bin/java.exe'
tender shard
errant bobcat
#

i used centos 7

ancient jackal
errant bobcat
#

but flag?

tender shard
errant bobcat
#

yes

tender shard
vocal cloud
errant bobcat
#

java -Xms5G -Xmx5G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs/ -Daikars.new.flags=true -jar paper.jar nogui

dusk flicker
#

yikes

errant bobcat
#

how to select java 17

vocal cloud
errant bobcat
#

i used java 8 but i cant start smp server for 1.17

tender shard
ancient jackal
vocal cloud
#

You can manually do /usr/lib/jvm/version/bin/java -jar xyz. I don't think this person should be using linux they don't understand it 7333_cringe

ancient jackal
#

can eventhandlers use other eventhandler returns?

dusk flicker
#

no

vocal cloud
young knoll
#

Event handlers don’t return a value

tender shard
#

in theory they could return any value they like

#

but

#

the plugin manager doesn't care about that return value

random epoch
vocal cloud
#

Sigh

dusk flicker
#

lmao

#

people ignoring the people giving the actual answer

ancient jackal
vocal cloud
young knoll
#

Shear event should work fine

#

Pretty sure I’ve used it

vocal cloud
ancient jackal
young knoll
#

Huh

ancient jackal
#

shear event fires and everything works except durability

vocal cloud
#

lol that's not my issue. Maybe time to rebuild spigot

tender shard
#

?paste

undone axleBOT
hybrid crest
#

Sup all! right now I have this

private static final int RANDOM_NUMBERS = 3;

but I want it so it will random select a number between 1, 2 and 3, any simple ideas?

ancient jackal
vocal cloud
tender shard
hybrid crest
young knoll
#

Yes?

tender shard
young knoll
#

Random number generation is quite popular in programming

tender shard
#

maybe the shear event's getItme() returns a clone

hybrid crest
#

But thanks! Will try it!

ancient jackal
#

ItemStack usedShears = player.getItemInUse();

#

I'm trying it

young knoll
#

It’ll probably be null

tender shard
#

I'd to this:

#
ItemStack shears = player.getInventory().getItemInMainHand();
if(shears.getType != Material.SHEARS) shears = player.getInventory().getItemInOffHand();
ancient jackal
#

going to try to rebuild it, wasn't working at all for some reason

tender shard
#

what do you actally want to do?

#

damage shears more than 1 when they are used to shear e.g. a sheep?

ancient jackal
#

shear sheep in a 3 block radius from the sheep that was sheared, damaging the shears by 1 everytime

#

works except for damaging the shears but I'm still trying your solution

tender shard
#

I'll try something myself

ancient jackal
#

it just doesn't work now, no console printing

#

wait it might've been a boolean I never set back to false

tender shard
#

I can confirm that setting the event's ItemStack's meta won't do anything

ancient jackal
#

for damage? isn't that how you set damage?

tender shard
#

yes, it seems like PlayerShearEntityEvent#getItem returns a clone of the shears

vocal cloud
#

That'd make sense

#

get item in players mainhand?

young knoll
#

Or offhand

#

Whichever is shears

tender shard
#
    private static final ItemStack getShears(Player player) {
        ItemStack shears = player.getInventory().getItemInMainHand();
        if(shears.getType()!= Material.SHEARS) shears = player.getInventory().getItemInOffHand();
        return shears;
    }

    @EventHandler
    public void onShear(PlayerShearEntityEvent event) {
        ItemStack shear = getShears(event.getPlayer());
        Damageable meta = (Damageable) shear.getItemMeta();
        meta.setDamage(meta.getDamage() + 50);
        shear.setItemMeta(meta);
    }
#

@ancient jackal

#

this works, I tested it

#

the event indeed returns a clone

ancient jackal
#

a painful discovery

young knoll
#

Weird

tender shard
#

@sullen marlin is this on purpose? wouldn't it make more sense to return the actual Item instead of item.clone() in PlayerShearEntityEvent#getItem() ?

#

I think the event should return the actual ItemStack, or at least the javadocs should mention that it's just a clone

ancient jackal
#

"Returns:
the shears"
-Javadocs

vocal cloud
#

Shear event won't even fire for me thonk

ancient jackal
#

shearing sheep is just something different smh

vocal cloud
#

I'm too tired for this apparently. I'm going to get some air

young knoll
#

Air, cave air, or void air?

vocal cloud
tender shard
tender shard
vocal cloud
#

No lol. I've been wondering why the event isn't firing and my test plugin has decided today is the day it no longer wishes to load on my server

ancient jackal
#

oh I figured out why it wasn't running anymore

#

@fresh templethandler was deleted

#

oh, hi even

loud haven
#

lol

tender shard
young knoll
#

The room

karmic grove
#

whats best way to keep a certain item from going in a certain inventory slot

ancient jackal
#

check if there's another slot to go in

karmic grove
#

wdym

#

like i dont want certain players to be able to use elytra

kind hatch
#

Permission node and inventory slot check.

vocal cloud
#

InventoryClick checks with equip checks

young knoll
#

equipping armor is a different beast

#

Since you can do it 3 ways

vocal cloud
#

Yeah not a fun task

young knoll
#

You could cancel the toggle gliding event instead

vocal cloud
#

Yeah but that might end up poorly

ancient jackal
#

has elytra
jumps
dies

vocal cloud
#

Some poor sod kermits die cause they didn't know they couldn't

vocal cloud
#

Don't do it Anakin

young knoll
#

I mean

#

You should probably inform them :p

karmic grove
#

i will xd

tender shard
young knoll
#

Not in yet

#

Or do you mean that one lib

tender shard
#

yes, the lib

young knoll
#

Fair enough

ancient jackal
tender shard
ancient jackal
#

oh yeah that too

tender shard
tender shard
vocal cloud
#

Yeah don't cancel the flight event or people are gonna mald when they jump off a mountain and eat dirt

young knoll
#

But that’s funny

vocal cloud
#

Yeah if you're a moderator

sterile token
#

Interface doesnt support synchornized void?

karmic grove
#

ok

tender shard
#

"synchronized" is an implementation specific thing

#

and interfaces of course do not directly implement anything

sterile token
tender shard
#

interfaces define WHAT something does, and not HOW it does it

#

and "synchronized" is about HOW something does sth

sterile token
#

Ah allright

#

I didnt know that

#

Always when i ask something i always learn something new

tender shard
#

:3

#

tbh I didn't know I was right, I just assumed it. here's an answer from stackoverflow which basically says the same thing that I said, though:

Because synchronized is an implementation detail. One implementation of the method might need to make the method synchronized, whereas another one might not need it. The caller doesn't care whether the method is synchronized or not. It's not part of the contract, which tells what the method does. Which synchronization technique, if any, is used to fulfill the contract is irrelevant.

karmic grove
tender shard
#

I only use the one and only proper build tool called maven 😛

karmic grove
#

i like maven too but this plugin is in gradle

tender shard
#

you could just copy paste all the classes of course

#

other than that - sorry, no idea about gradle :/

#

it's probably just
implementation "groupId.artifact"
like usual

sterile token
#

What a lovely yet

#

🤔

#

I will give more oportunities to sockets and let netty alone

karmic grove
#

on the EntityToggleGlideEvent how do i get the entity thats gliding and turn it to player

tender shard
#

tbh you should never ever care about sockets when doing SQL stuff

bright jasper
#

Totally stole config comments from luckperms

bright jasper
#

🤡

#

Well its well written docs and applies to mine too so i think its fine

tender shard
#

to get the entity?

#

.getEntity()

#

to turn it into a player? check if it's a player, then (cast) it

karmic grove
#

lemme google cast

sterile token
bright jasper
#

Are you using bungeecord/spigot?

sterile token
bright jasper
#

Yeah theres a way to do it then

tender shard
#

@karmic grove ```java
public void onGlide(EntityToggleGlideEvent event) {
if(event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
...

bright jasper
#

Lemme find some code I did

sterile token
tender shard
sterile token
#

It will help me a lot. Because i always get the main thread lock or NPE exceptions when sending or receiving

tender shard
sterile token
#

I dont know which name put cuz. Connection its already used by the interface

bright jasper
#

Here was something i did with cross server teleport

#
    private void sendPlayerTeleport(ProxiedPlayer player, ProxiedPlayer target) {
        ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeUTF(player.getUniqueId().toString()); // User to teleport
        out.writeUTF("player");                     // Set teleport type to player
        out.writeUTF(target.getUniqueId().toString()); // Teleport target

        ServerInfo targetServer = target.getServer().getInfo();
        targetServer.sendData(Channels.TELEPORT, out.toByteArray());

        if (!player.getServer().getInfo().getName().equals(targetServer.getName()))
            player.connect(targetServer);
    }

this is bungee side

#

🤡 what

sterile token
#

Nothin it weas wrong message

bright jasper
#

ah

tender shard
bright jasper
#

nah im giving him examples

tender shard
#

oooh ok

bright jasper
#

he needed examples for using bungee-spigot

tender shard
#

sorry lol

sterile token
#

But i dont whant that

#

Cuz plugin message need 1 player

young knoll
#

Can we /tpa the 1.8 users out of 1.8?

bright jasper
#
if (!channel.equalsIgnoreCase(Channels.TELEPORT)) return;
        ByteArrayDataInput in = ByteStreams.newDataInput(bytes);

        UUID fromUUID = UUID.fromString(in.readUTF());
        Player from = Bukkit.getPlayer(fromUUID); // Will be null if player not in server yet

sterile token
#

And i need working without player

#

😡

#

That my big problem

bright jasper
#

without a working player you are fucked

#

go use TCP/gRPC

sterile token
#

I thought you mentioned me you have tcp exampled

#

With sockets

#

That why i get emocionated

bright jasper
#

check this out

#

its the easiest its gonna get

sterile token
#

Allright

bright jasper
#

i think there might be a java grpc lib

sterile token
#

What should be Future ?

#

Like i confuse Future with Async

bright jasper
#

future is a task queued

#

its basically like a async lambda

#

anything you tag onto the end of a future with .then or whatever you use for futures will also be queued with the result of the original future as params

#

futures ARE async

sterile token
#

ah that why

tender shard
delicate lynx
#

that's dope

tender shard
#

I'll add support for github release too now I guess

delicate lynx
#

I use my own github api since I like to look at github releases instead of spigot releases

tender shard
#

that's exactly what I want to add now

#

I'd be very happy over a pull request or if you could share your json code to extract the version from a github repo pls

delicate lynx
#

mine takes a bit more to setup since it's not only for plugins

tender shard
#

could you maybe DM me your code to get the version from a given github link?

#

that would be awesome

ornate heart
#

How can my config file support accented letters? When I save one to config it saves as this

dry forum
#

i have no xp and im level 0 (xp) but when i use p.getExpToLevel() it says im level 7? why lmao

fast path
#

It meaning to next level you need how many experiences.

dry forum
#

oh i thaught it meant getting ur level

#

how would i get a players level then

fast path
#

Hm

#

Wait me

#

Just getLevel

dry forum
#

thanks

fast path
#

anytime.

low temple
glossy dirge
#

Hello how do i make it color ?

        logger.info("[Spigot] Initializing...");
        logger.info("[Spigot] Enabled");

low temple
#

so

logger.info(ChatColor.ChatColor.translateAlternateColorCodes('&', "&7[Spigot] &3Initializing...");
logger.info(ChatColor.ChatColor.translateAlternateColorCodes('&', "&7[Spigot] &3Enabled"");

for example

dusk flicker
#

Hex colors.

#

Best thing ever added

ancient jackal
#
        boolean hasSilkTouch;
        try {
            hasSilkTouch = tool.getItemMeta().hasEnchant(Enchantment.SILK_TOUCH);
        } finally {
            hasSilkTouch = false;
        }```
why is hasEnchant nullable? this try statement still throws null pointer exceptions because hasSilkTouch is primitive
#

it returns a primitive value that is nullable

quaint mantle
#

Boolean then?

quaint mantle
#

then it would always be false anyway

buoyant viper
#

isnt it getItemMeta that is nullable

loud haven
#

getItemMeta() can return null

ancient jackal
#

it returns true if it has the enchantment and every other test I've done, it returns null

#

maybe it's itemmeta yeah

loud haven
#

you didn't check if itemmeta is null before trying to check hasEnchant on it

buoyant viper
#

how could one go about adding a custom potion effect, even if it requires NMS

#

or even just 'spoof' a potion effect through packet hackery

hasty prawn
#

Even if you did manage to do it, you'd need a resource pack for the client to render it properly (and you might even have to replace a current one for it to do that, not sure)

hexed hatch
#

and my reason for wanting it wasn't that great in hindsight

zinc spire
#

how can i get Spruce wood in 1.8.8 API ? i can't see SPRUCE_WOOD enum

#

can't*

quaint mantle
#

they use the tint or something

quaint mantle
#

monke alert

#

we dont support 1.8 so

#

¯_(ツ)_/¯

vocal cloud
#

Most people here don't use 1.8.8 so you'll have to wait

hasty prawn
#

There isn't a SPRUCE_WOOD enum, it's just LOG with a magic value. @zinc spire

#

Dunno what that magic value is, sure you can find it somewhere.

vocal cloud
#

I bet if you port it to 1.18 you'll find it mmlul

hasty prawn
#

true Kappa

blazing rune
#

Hello so like I wanna make this heal soup thing in kitpvp. I got the healing and stuff down but what I dont know how to do is to clear the specific slot which contains the soup that was used

blazing rune
hardy swan
#

decrement item's amount

#

if getting item at hand returns a copy you can set the resultant item back to hand

blazing rune
#

Okk

lethal coral
#

hello. I'm currently trying to make a scoreboard using ScoreboardObjective, ScoreboardScore, and ScoreboardDisplay. I've attempted to follow the tutorial to a T and even used the exact code. I've received this error when using the exact code and using my own code:

sullen marlin
#

DO NOT USE NMS FOR SCOREBOARDS

#

there is a perfectly good scoreboard API that does every single thing NMS does

#

and there has been since scoreboards were added to the game

quaint mantle
#

spigot api

lethal coral
lethal coral
#

I can see at the top of the tutorial this was made before the api was ready

#

It'd just be easier to use the packets in my case

spiral light
surreal valve
torn oyster
#

is there a way to check if a WorldCreator will create a new world or load an existing one?

red sedge
#

is registering too many events bad for performance

#

so like

#

multiple blockbreakevents

#

etc

worn tundra
#

Depends on how heavy checks and operations they have.

#

Light checks first and heavy ones after

#

So you can exit the event early

low temple
#

its just not feeding the player?

surreal valve
#

/doctor works but /feed doesn't

#

by feeding i mean

#

increasing it saturation to max

worn tundra
#

Why do you upload it as .txt

surreal valve
#

What's the problem?

low temple
surreal valve
#

ok

low temple
#

I believe saturation is their health regeneration rate based on food

surreal valve
#

okay

surreal valve
low temple
#

java should autocast 20 to 20.0

surreal valve
#

hm okay

#

Same error

low temple
#

so ur code isnt registering ur command

surreal valve
#

Maybe

#

but, i registred it

#

in main onEnable aswell as plugin.yml

low temple
#

if ur chat doesnt autocomplete ur command when u type it then it means its not being registered properly

surreal valve
#

yup, it doesn't autocomplete

#

I will check and try to register again

red sedge
#

all of them very light

#

but will having multiple methods part cause performance issues

surreal valve
low temple
low temple
#

maybe try loading the feed command first and seeing if that allows you to use it

surreal valve
#

Well, that shouldn't happen but, i'll try

hollow bluff
low temple
#

yeah it shouldnt but you never know

hollow bluff
#

And learn to creat commands, this is the second time mate with the same thing

surreal valve
surreal valve
hollow bluff
#

@surreal valve your command doesnt work because the equals is different from the command you registered

surreal valve
low temple
#

using aliases will still reference the same command

surreal valve
#

hmm okay

hollow bluff
surreal valve
#

yeah

#

damn bro

#

you misunderstood

low temple
surreal valve
#

yeahh

#

when i click on the hoverable thing it excecutes the command

hollow bluff
#

Still wont work because he is probaby doing /feedmeplease

low temple
#

his command creates a clickable dialogue thing that makes him run the feedmeplease arg

surreal valve
hollow bluff
#

clearly doesnt work

surreal valve
#

Okay so explain why does /doctor works

low temple
#

I cant see why ur plugin isnt registering the command

surreal valve
#

even i copy pasted the doctor thing and edited it to feed the player

low temple
#

especially cause its basically a copy paste of the doctor command

surreal valve
#

hm

gleaming zenith
#

What does "relative" mean in player.setPlayerTime(long time, boolean relative); ?

surreal valve
#

so i copy pasted

#

what's the error tho?

low temple
#

I honestly dont know, either im blind asf or idk

hollow bluff
#

?paste the full class

undone axleBOT
surreal valve
#

i have 3

hollow bluff
#

Command class to feed

low temple
#

Any error in the console? @surreal valve

surreal valve
#

Nope

low temple
#

check when the plugin is loaded/enabled

surreal valve
#

If /doctor works

#

then it is enabled then lol

red sedge
#

How can I check the title of an inventory

low temple
red sedge
#

nor a getview

#

there is a getviewers func

#

tho

low temple
#

I forget the object type you need

young knoll
#

No but there is a getView in the inventory events

red sedge
#

Ohhh

#

okay got it

low temple
surreal valve
#

what's wrong

low temple
#

I honestly dont know

surreal valve
#

same

low temple
#

maybe try changing the name?

#

when you reload the plugin are you reload the server or just the plugin?

#

wait nvm ur "Launch" plugin also is reloaded

#

im assuming ur op'd

surreal valve
#

the server

#

rl confirm

surreal valve
low temple
#

Yeah I know I’m just trying to brainstorm

#

Maybe ONLY register the feed command

#

And see if that works

surreal valve
#

ok

tepid crater
#

If anyone can help me i appreciate ^^

surreal valve
#

why it doesn't work

#

i will check too

red sedge
#

why are people so against using object#requirenonull

low temple
#

Very strange

sharp flare
#

May I ask when was Steerable interface added

young knoll
red sedge
#

yeah so its good to use

young knoll
#

Useful for things that should never be null I guess

#

But if you have something that may be null, don’t use it

red sedge
#

yeah

opal juniper
#

?stash

undone axleBOT
sharp flare
#

thanks

opal juniper
#

there are branches for each version iirc

sharp flare
#

gonna have to find it manually

#

not sure if it got added in part of bukkit or spigot

young knoll
#

Bukkit

sharp flare
#

found it thanks

tepid crater
#

@chrome beacon So basically he is remapping to much ahaha, so i have some method that is from my nms interfaces but he is remapping that too, any idea on a way i can make so its not necessary to rename for another thing?

red sedge
#

Inventory inv = Bukkit.createInventory(null, 9, "Stone Chest");

#

this creates a 3row inventory

worn tundra
#

1

#

row

tepid crater
#

1 * 9

#

2 * 9 -> two rows

red sedge
#

yeah

#

so

#

like any ideas?

tepid crater
#

What do you want to achieve

red sedge
#

create an inventory with only a row

tepid crater
#

just leave 9

tepid crater
red sedge
#

yeah it doesnt work

worn tundra
#

Oh?

#

What doesn't work

#

Are you by any change forgetting to make a player open that inventory?

red sedge
#

it creates an inv with 3 rows

worn tundra
#

And?

red sedge
#

i need it with only a row

red sedge
worn tundra
#

Show your cose

#

code

red sedge
#

okay

#

?paste

undone axleBOT
red sedge
worn tundra
#

Nah cause there is no way

#

Are you sure that code is compiled?

red sedge
#

yh

tepid crater
#

make sure on that lol

worn tundra
#

^

tepid crater
#

decompiling your own code

#

to see if actually is doing that

worn tundra
#

Or just, you know

tepid crater
#

my ide already troll me several times with that

worn tundra
#

Try changing the title

tepid crater
#

yeah

#

or that lmao

worn tundra
#

And recompiling

tepid crater
#

is more easy

red sedge
#

okay so

#

weird thing

#

when the event is cancelled

#

nothing happens

#

when the event is not cancelled

#

the inventory opens since im right clicking to a chest

#

but the title of that chest is stone chest

#

and yes it is compiled

steady rapids
#

hi, does anyone know what event should I use to "grab a spawner"? I need to set every spawner to spawner.setRequiredPlayerRange(20); I was thinking to do this when they are loaded but i dont know what event should I use?

blazing rune
#

Heyy uh I'm trying to like get a players empty slots and fill them up with items anyone care to help..?

red sedge
blazing rune
red sedge
#

uh

#

while loop

#

like

#

if player has space

#

add itemn

blazing rune
#

Ok..

#

I'll give that a try

red sedge
#

or well

grim ice
#

So in MySQL for example if im making smth like

#

VARCHAR()

red sedge
grim ice
#

i have to add

#

the size of the varchar

#

how do i make it unlimited

#

or like 100k

#

its actually an int not a varchar

#

do i just do INT(100000)

red sedge
#

yeah prob

#

never used mysql but probably

high sluice
#

how much text are you storing? mysql has 'TEXT' and 'LONGTEXT' which store off-table

grim ice
#

a number up to a million

#

wait, its the amount of characters not the actual number

#

fuck im an idiot

#

it should be the amount of characters in it

#

right

#

so INT(6)

#

will be

#

999999

#

max

#

right

red sedge
#

yep

high sluice
#

int is weird in that the number shows how many characters will be read in the command line client

#

if its an int column itll always be 4 bytes

#

varchar is the amount of characters

grim ice
#

and int?

#

itll be the amount of characters

#

too?

high sluice
#

no, int only affects the display

grim ice
#

so is 7 ok

high sluice
#

you can just use int without a constraint there though

high sluice
steady rapids
#

hmm

#

like?

sullen marlin
#

Why tf would you store a number as text

#

And yes that event is correct

#

There’s a method for getting only tiles so it’ll be fast

red sedge
#

tiles?

hardy swan
chrome beacon
grim ice
#

i saw that in a tutorial

#

how do i make no maximum for the int

tepid crater
grim ice
#

i mean it will have a max which is integer limit

sullen marlin
#

Int has a maximum of 2 billion

grim ice
#

but how do i set it to that

#

ik

high sluice
#

you wouldn't store a number as text, you would store text of up to a million characters as text

sullen marlin
#

So you really need more

grim ice
#

nah 2bil is enough

tepid crater
grim ice
#

so uh

#

INT(8) is enough

#

right?

#

cuz 8 characters

sullen marlin
#

Its not 8 characters

tepid crater
#

u are talking about sql?

high sluice
#

just 'int' is enough

grim ice
tepid crater
#

i think you have something called SMALLINT

#

or something

tepid crater
grim ice
#

yes it is mysql

tepid crater
#

so if you want to do cross sql idk if is good

sullen marlin
#

() only changes formatting, it doesn’t change what can bestored

grim ice
#

o

#

oh so INT() is fine

tepid crater
grim ice
#

alright

sullen marlin
#

INT and BIGINT are the two largest types

#

Int = java int , bigint = java long

grim ice
#

i want it to display the whole number

#

how can I do that

sullen marlin
#

Longs have a max value of like 10^18, so they’ll certainly be long enough but I seriously doubt you need such a big value

grim ice
#

nah int is good

sullen marlin
#

So then just make an INT column

#

No ()

grim ice
#

o ok

#

ty

quaint mantle
#

uh

#

I need some help

#

please

#

this is the error I am getting

void wraith
#

Hi! How can I create placeholders that e.g. i write a killstats plugin and get the kills of a player, from my plugin, in the config of the TAB plugin on the scoreboard. (e.g. %kills%)?

quaint mantle
#

item manager code

package com.jerry.com.jerry.Com.items;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;

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

public class itemManager {

    public static ItemStack wand;

    public static void init() {

    }

    private static void createWand() {
    ItemStack item = new ItemStack(Material.BLAZE_ROD);
    ItemMeta meta = item.getItemMeta();
    meta.setDisplayName("&4Ember Rob");
    List<String> lore = new ArrayList<>();
    lore.add("&4Coming Soon!");
    lore.add("&4Test!");
    meta.setLore(lore);

    //Shaped Recipe
    ShapedRecipe sr = new ShapedRecipe(NamespacedKey.minecraft("wand"), item);
    sr.shape("B  ",
              " S ",
              "   S");
    sr.setIngredient('B', Material.EMERALD);
    sr.setIngredient('S', Material.DIAMOND);
    Bukkit.getServer().addRecipe(sr);



    }
}
hardy swan
hardy swan
#

give the error message a read

#

it is caused by an exception due to an illegal argument

#

for which the stacktrace provides the exact place where the exception is thrown

sullen marlin
#

Psst you never set the wand variable

quaint mantle
#

really sorry for the ping

sullen marlin
#

wand = item

#

Learn java

quaint mantle
#

learning java

hardy swan
#

😬

quaint mantle
hardy swan
#

he just told you

quaint mantle
#

howww?

#

like

#

the code thinggg

hardy swan
#

add an assignment statement

#

but i can't tell whether that's truly what you intended

#

for the most part you did correctly create the recipe

topaz sinew
#
@EventHandler
    public void openEnderChest(InventoryOpenEvent e){
        if (e.getInventory().getType() == InventoryType.ENDER_CHEST){
                e.setCancelled(true);
                new EnderChestMenu(plugin, new MenuData((Player) e.getPlayer())).open();
        }
    }

Hi, I'm trying to cancel opening an enderchest and instead open my own GUI but my enderschest stays "open" after I close my GUI, how can I fix this?

steady rapids
#

anyone knows what function to use to set a mob spawner RequiredPlayerRange?

#

i need to increase the minimum distance required from the player to work

red sedge
#

How can I assign an event to inventory click

#

but like the type where you just drag while clicking to equally put items

#

or like

#

right click to put one

#

it doesnt send a inventoryclickevent

spiral light
#

drag items in inventory is InventoryDragItemEvent

spiral light
hardy swan