#help-archived

1 messages ยท Page 225 of 1

kind crow
#

why not
@rare prairie you can specify entity type with the /kill command, but not the world

rare prairie
#

essentials/cmi have this command, so you can specify world name btw

kind crow
#

If it's not possible without any plugins, I'll better write my own ๐Ÿ˜„

undone narwhal
#

If someone got the answer just mention me (or pm) ๐Ÿ™‚ Thanks

rare prairie
#

If someone got the answer just mention me (or pm) ๐Ÿ™‚ Thanks
why you not take a look at worldedit shapes? ๐Ÿค”

#

or what

undone narwhal
#

Yeah that's what I'm looking for

stiff oasis
#

emmm

#

how can i fix it?

undone narwhal
#

But not sure about how to proceed correctly

dusky sigil
#

how can I delay a task without repeating it?

#

Not using a runnable

rare prairie
#

Thread.sleep

#

or use java timer

dusky sigil
#

thread.sleep shuts it all down

#

and freezes the world

rare prairie
#

then do that in another thread

dusky sigil
#

hold on

#

can i do that using a scheduler?

rare prairie
#
CompletableFuture.supplyAsync(() -> {
  Thread.sleep(5);
}
dusky sigil
#

can i do that using a scheduler?
I want to count with ticks

rare prairie
#

then use scheduler

undone narwhal
#

1 sec = 20 ticks

#

So 1 tick = 1/20 seconds

#

1 seconds = 1000ms

#

Simple conversion

burnt bay
#

Hey guys how do I set sign rotation?

subtle blade
#

There is a Sign BlockData type

burnt bay
#

Got it

subtle blade
#

getBlockData(), cast to sign, modify, setBlockData()

burnt bay
#

Just now

#

But thank you so much

subtle blade
#

Note there are 3 different Sign types in Bukkit eh? You want the org.bukkit.block.data.type.Sign one ;P

burnt bay
#

I know ahaha, its a bit of a pain

frigid ember
#

I need help

subtle blade
#

Here's hoping we get rid of MaterialData in the near future

#

Maybe 1.17, I'll bring it up to md

frigid ember
#

This help isn't really bukkit related, but it requires some decent amount of thinking and I can't get it right idk why

burnt bay
#

I always liked the vanilla DIrtBlock extends Block

dusky sigil
#

Why isnt this working? ```java
BukkitScheduler scheduler = getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {

                nowAir.setType(Material.AIR);
                return;

             }
        },1000,1000);```
#

Its setting the block to air but without delay

subtle blade
#

Use the runTaskTimer() method instead

#

scheduleSyncRepeatingTask() is old and discouraged

dusky sigil
#

ew OLD STUFF

subtle blade
#

Should work fine though

dusky sigil
#

k ill do that

burnt bay
#

Whats the best option for checking when someone opens a container?

subtle blade
#

InventoryOpenEvent

burnt bay
#

TY

dusky sigil
#

oh wait..

#

I set it to air before the scheduler..

#

..............................

burnt bay
#

Is that called on the player inventory opening?

subtle blade
#

Yes, though if you just want containers you can check for the InventoryHolder

burnt bay
#

Ok ty

subtle blade
#

Could be either an entity or a block

#

(see subinterfaces)

frigid ember
#

The thing is, I have different arrays with about hundreds of values.
But the thing is, I need to pass in these values in 3 pairs.
Now what I want to do is create a list containing an array and this array will contain the 3 pairs.
So that I can iterate over this list, and pass in each of the 3 pairs.
I want to end up with this->

List<Float[]> vertexes = new ArrayList<>();
for(Float[] vertex : vertexes) {
passInThePairsOfThree(vertex[0], vertex[1], vertex[2]);
}

subtle blade
#

Okay so what's the issue?

tiny dagger
#

^

subtle blade
#

Aside from the fact that you don't create a Vector3f object or something

#

arrays are icky in this case lol

frigid ember
#

yep

#

its just

#

every tutorial uses a large array

#

or every doc

#

instead of a class called Vertex as I did in my old project

#

btw I just switched over to cpp

#

so i recoded everything

#

btw and sometimes i hardcode some objects with their vertices (quite simple objects like cubes)

#

so it would be annoying always creating another class

#

for example this is what i wrote

#
static float cube_vertices[] = {
    -0.5f, 0.5f, 0.0f,
    -0.5f, -0.5f, 0.0f,
    0.5f, -0.5f, 0.0f,
    0.5f, 0.5f, 00.0f,

    -0.5f, 0.5f, 0.5f,
    -0.5f, -0.5f, 0.5f,
    0.5f, -0.5f, 0.5f,
    0.5f, 0.5f, 0.5f,

    0.5f, 0.5f, -0.5f,
    0.5f, -0.5f, -0.5f,
    0.5f, -0.5f, 0.5f,
    0.5f, 0.5f, 0.5f,

    -0.5f, 0.5f, -0.5f,
    -0.5f, -0.5f, -0.5f,
    -0.5f, -0.5f, 0.5f,
    -0.5f, 0.5f, 0.5f,

    -0.5f, 0.5f, 0.5f,
    -0.5f, 0.5f, -0.5f,
    0.5f, 0.5f, -0.5f,
    0.5f, 0.5f, 0.5f,

    -0.5f, -0.5f, 0.5f,
    -0.5f, -0.5f, -0.5f,
    0.5f, -0.5f, -0.5f,
    0.5f, -0.5f, 0.5f
};```
subtle blade
#

Should definitely not be loading model data from source

#

that's one way to make you hate yourself

frigid ember
#

just some basic things

#

im too lazy to already start importing some .obj or .fbx

#

what i can do is

#

on application startup, i can store a list containing arrays of the values

#

so I don't calculate every frame(would be dumb)

#

if you already picked up

#

yep its game

#

actually a game library, but ye

subtle blade
#

i'd figured as much. the vertex buffering gave that away in your first snippet

frigid ember
#

ok

#

so can we do this

#

or do i have to rewrite each array making a vertex class manually

#

for every 3 values

#

atleast for now

#

its in cpp

#

i can show u what i tried

#

but it failed miserably

#
//A 3D vertex contains 3 floats(x, y, z)
    std::vector<float*> vertexes = std::vector<float*>(_model._mesh.get_vertex_count());

    int vertex_index = 0;
    for (int i = 0; i < _model._mesh.vertices_length; i++) {
        //1st
        if (i == 0 || i + 1 % 3) {
            float vertex[3];
            vertex[0] = _model._mesh.vertices[i];
            vertexes.push_back(vertex);
            if (i != 0) {
                vertex_index++;
            }
        }
        //2nd
        else if (i - 1 % 3) {
            vertexes[vertex_index][1] = _model._mesh.vertices[i];
        }
        //3rd
        else if (i - 2 % 3) {
            vertexes[vertex_index][2] = _model._mesh.vertices[i];
        }
    }

    for (float* vertex : vertexes) {
        
        std::cout << "vertex 0: " << vertex[0] << ", vertex 1: " << vertex[1] << ", vertex 2: " << vertex[2] << std::endl;
    }```
#

a vector is a list in c++

#

and the float* is an array

subtle blade
#

i mean if it makes you feel any better, c++ has a tuple class lol. though you're probably fine to stay with float arrays if you really want

#

what about it isn't working? you're giving snippets of code saying it doesn't work but aren't saying what about it isn't working

wispy pewter
#

People think we are some kind of wizards who can solve isues without any explanation

subtle blade
frigid ember
#

it spams some random numbers lmao

#

the first number seems legit

#

the next one is 0

#

the 3rd is some very small

#

decimal

wispy pewter
#

what about if (i % 3 == 0) {

frigid ember
#

i just want to know how to code such a method

#

i want to do every third

#

i started i as 0

#

maybe i should start as 1

subtle blade
#

i don't know why you're iterating every one element when you should be certain you have a vector of elements that should be a multiple of three

frigid ember
#

im insertig into the vector

#

i need to insert every element

subtle blade
#
for (int i = 0; i < length / 3; i += 3)
    firstElement = elements[i];
    secondElement = elements[i + 1];
    thirdElement = elements[i + 2];
#

do your processing

frigid ember
#

i want to have it like this:

for(float[] array : vertexes) {
dosomething(array[0], array[1], array[2]);
}

#

ok

jagged torrent
#

I have a List implementation for elements with a given id and owner
I want to ensure all elements have a unique id and the same owner

#

how do I implement Collection#replaceAll(UnaryOperator)

subtle blade
#

isn't that a default method?

jagged torrent
#

I want to ensure all elements have a unique id and the same owner

subtle blade
#

ah, can't insert if it's not unique, got ya

#

You would have to iterate across all elements in the list and apply that unary operator. perform your checks before assigning it to the underlying data structure

#

throw an exception if any of your conditions are not met

jagged torrent
#

then I'd have to store the result in a new list, check conditions there and then replace all elements in my list

subtle blade
#

not necessarily. you would do that in the loop

frigid ember
#

choco, does this look good?


    int count = 0;
    for (int i = 0; i < _mesh.vertices_length; i+= 3) {
        float arr[3];

        arr[0] = _mesh.vertices[i];
        arr[1] = _mesh.vertices[i + 1];
        arr[2] = _mesh.vertices[i + 2];
        vertexes[count++] = arr;
    }
blazing burrow
#

whats the best way to filter out all the legacy materials in materials.values()?

frigid ember
#

I used your idea

#

ima test it

subtle blade
#
for (int i = 0; i < elements.size; i++) {
    T newElement = unary.apply(elements[i]);
    if (newElement.isInvalid()) {
        throw new IllegalArgumentException("NO! BAD >:((");
    }
    elements[i] = newElement;
}```
#

obviously oversimplified but you get the gist of it

jagged torrent
#

that would give O(n^2) time complexity

#

:(

subtle blade
#

Atin, legacy materials aren't present at runtime. They won't be part of values() if your api-version is set to 1.13

frigid ember
#

im an idiot

#

lmao

subtle blade
#

Would be O(n) would it not?

#

Which you kind of have to have if you're performing a unary operation on n elements

jagged torrent
#

checking if there's an element with the same id is O(n)

#

afaik

subtle blade
#

So to me this seems like an inappropriate use of a List

#

A Set implementation would likely be better

blazing burrow
#

Ohh okay @subtle blade i havent set an api version but will do thanks

jagged torrent
#

oh I completely forgot about that xd

#

I need to perserve insertion order so I went with a list but ig LinkedHashSet can be used

frigid ember
#
mesh _mesh = _model._mesh;

    //A 3D vertex contains 3 floats(x, y, z)
    std::vector<float*> vertexes = std::vector<float*>(_mesh.get_vertex_count());

    for (int i = 0; i < _mesh.vertices_length; i+= 3) {
        float arr[3];//needs to be initiated

        arr[0] = _mesh.vertices[i];
        arr[1] = _mesh.vertices[i + 1];
        arr[2] = _mesh.vertices[i + 2];
        vertexes.push_back(arr);
    }

    for (float* vertex : vertexes) {
        
        std::cout << "vertex 0: " << vertex[0] << ", vertex 1: " << vertex[1] << ", vertex 2: " << vertex[2] << std::endl;
    }```
#

i got this

subtle blade
#

I see

#

Yeah a LinkedHashSet is probably what you want so it's doubly-linked

#

you should definitely throw an exception if your vector size isn't a multiple of 3 though, retrooper

#

but yeah that would be fine as far as i can tell

frigid ember
#

it seems to only be printing the first 3

#

im not sure

#

i was doing it on render method

#

let me do it once

#

so i can see

#

yep it only prints the first 3

#

hmm

#

i think i got it

surreal trail
#

how would i go about getting a Black Leather Helmet with a material of LEATHER_HELMET im not sure if the plugin supports colored leather so im testing it but im not sure how to add the specifics to dyed leather

subtle blade
#

It does. LeatherArmorMeta

frigid ember
#

I have to remove a part of List<Data> which stores List<String> for lore out of the hashmap
im storinng lore as a list bcz it will be too long to read when its not a list

        TextComponent msg = new TextComponent("Helpop " + String.join(" ", args));
        msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(applyCC("&aRight Click To Mark As Done!")).create()));
        msg.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/RemoveUUIDCMD"));
//In the RemoveUUIDCMD
            guiInformation.remove(player.getUniqueId(), new Data(msg.getText()));```
#

but this doesnt work

#

since getting the msg wont get a list<String> of text

#

but just the String

bold anchor
#

What

crisp widget
#

Which part of the code you've posted doesn't work?

#

You've mentioned lists but there aren't any there

frigid ember
#

__ guiInformation.remove(player.getUniqueId(), new Data(msg.getText()));__

bold anchor
#

Thatโ€™s a new object

frigid ember
#
    private final HashMap<UUID, List<Data>> guiInformation = new HashMap<>();```
crisp widget
#

Can you put the full code into a hastebin or pastebin?

frigid ember
#

yea

bold anchor
#

Use an ArrayListMultiMap for proper arraylist map support

frigid ember
surreal trail
#

Choco let me rephrase im using a mobs plugin that has custom armor im just not sure how to add the meta

frigid ember
rare prairie
#

whats this

guiInformation.remove(player.getUniqueId(), new Data(msg.getText()));

You've made a new class intance of Data

crisp widget
#

@surreal trail Via config or via code? and which plugin?

rare prairie
#

thats makes no sense

frigid ember
#

ups

rare prairie
#

remove the new Data thing from remove method, and only use one player.getUniqueId

frigid ember
#

but that will still return string

#

not List<String>

rare prairie
#

HashMap can find the saved data if you give the corresponding key

surreal trail
#

config and elitemobs currently all i know is that it uses the Material.NAME but not sure if it uses the meta

rare prairie
#

but that will still return string
wat

frigid ember
#

im saving multiple List<String> for each player

#

and I have to get the right one

#

to remove from the hashmap

rare prairie
#

Then why you not use the Map#get method to get the list of players?

subtle blade
#

Choco let me rephrase im using a mobs plugin that has custom armor im just not sure how to add the meta
oh you're trying to configure one?

surreal trail
#

yea i can do LEATHER_HELMET to get a leather helm but im trying to see if we can dye them aswell

frigid ember
#

I have to remove the one from one player, just said it stores that for multiple players

subtle blade
#

@slim hemlock SUPPORT YOUR USERS PES_AngeryKid

#

frikken idiot

surreal trail
#

lol

frigid ember
#

why would I get it when I have to get the correct one out of 5? for example

surreal trail
#

i asked a 2nd question there aswell hes busy atm

subtle blade
#

i honestly don't know how to configure elite mobs lol. I'm sure he can respond when next available

deft sable
#
import java.util.logging.Handler; 
final Handler myHandler = new Handler (myConfig, levelCost);

Cannot instantiate the type Handler
how to fix this ? ^^

subtle blade
#

he's generally pretty on top of that kinda stuff

bold anchor
#

Oh, i thought you responded to some server admin who was a dumdum

#

Logging handler what

rare prairie
#

why would I get it when I have to get the correct one out of 5? for example

guiInformation.remove(player.getUniqueId());

is good enough to remove from memory

subtle blade
#

What are you instantiating a Handler for? o.O

deft sable
#

to get config file

frigid ember
#

yes that will remove all infoi about the player

#

while its storing a list of info

subtle blade
#

A YAML configuration?

bold anchor
#

Config what?

surreal trail
#

yes he is but right now i know hes busy

subtle blade
#

Or a logging configuration?

frigid ember
#

I only need to remove a part of the info

deft sable
#

yml file

subtle blade
#

Yeah that's definitely not how that works ;P

#

YamlConfiguration#loadConfiguration()

surreal trail
#

and choco this is the only info we have on material
material sets the item material. All material names are derived from the spigot API. You can find the list of valid material names here.

#

and it links to spigot

deft sable
#

ohh ok

subtle blade
#

Yeah, I'm sure he has a way to load dye colours, just don't know how he does it

crisp widget
#

Somebody on the EliteMobs discord might have better insight

rare prairie
#

while its storing a list of info

List<Data> oldList = guiInformation.get(player.getUniqueId());
for (Data data : oldList) {
    data.setList(Arrays.asList("y1"));
}
guiInformation.remove(player.getUniqueId());
#

@frigid ember

frigid ember
#

ima try thanks

#

and where's setList coming from? :p

rare prairie
#

from data, also this is an example, you should configure it yourself how you want

frigid ember
#

ohh ok

surreal trail
#

im thinging when custom models was added it broke dyes

mild nebula
#

Pretty sure theres a get amount method

subtle blade
#

There isn't, but you can use the result of #all(Material)

mild nebula
#

Nvm then

subtle blade
#

double count = all(Material.GOLD_NUGGET).values().stream().mapToDouble(ItemStack::getAmount);

#

(that obviously doesn't remove them, you can remove with #remove(Material))

mild nebula
#

Hey choco! I was wondering if im allowed to dm you really quick i need to ask you smth regarding premium resources. May i?

subtle blade
#

most questions should be covered by the guidelines

glossy summit
#

hey can anyone help me, ive got my own spigot server for my brothers and when i try to do (/rg flags global) it brings up (page 1 of 6 >>>) but i have no idea how to get the the other pages ive tried everything i could think of and searched everywhere but no luck just need some help please

subtle blade
#

click the arrows in chat with your mouse ;P

#

That whole chat flag message is interactable

glossy summit
#

ive read that it is, thing is it dosnt work

bold anchor
#

Which version are you using?

glossy summit
#

1.16.1

subtle blade
#

Spigot? Or CraftBukkit?

glossy summit
#

spigot

subtle blade
#

Then it should definitely be interactable wot

glossy summit
#

its not

#

maybe im clicking in the wrong area

bold anchor
glossy summit
#

its the (>>>) right

subtle blade
#

yes

glossy summit
#

yeah dosnt work

subtle blade
#

Well, your alternative is to use /rg flags global -p 2 to go to page 2

#

(and so on and so forth)

#

Uh, sorry, /rg flags -p 2 global

#

I think order matters

glossy summit
#

OOH thanks haha

#

i tried doing /rg flags global page 2 but that didnt work, had no idea it was -p

#

thanks so much been stuck on that for hours

subtle blade
#

o/

glossy summit
#

is there also a way to make a pvp area where you lose your items if you die in the region or do i need to get another plugin

subtle blade
#

don't know why the message isn't clickable for you though

#

there's probably a flag for item drops

#

Yeah, item-drop

glossy summit
#

yeah im not too sure i thought it wouldve been a mod or texture pack but my brother couldnt do it and his got plain vanila

#

okay thanks

#

the item-drop dosnt work

rare prairie
#

it would better to ask in enginehub discord

glossy summit
#

okay ill try thanks

noble anchor
#

how can i disable advancements for specific Player?

tawdry venture
#

Hey! I want to send a custom payload packet using player#sendPluginMessage but it doesn't get sent to the player, any idea?

vast jungle
#

What's your plugin code and your mod code to receive it?

tawdry venture
#

target.sendPluginMessage(getHandler(), getChannel(), buffer.getBuffer().array());

#

its heavily abstracted on mod side, but I can guarantee that it's not recieved

vast jungle
mellow wave
#

Did you register the channels?

tawdry venture
#

thats a good question, might be the solution

#

yes it's registered

mellow wave
#

Are there any errors then?

#

And how are you detecting if the message is being sent

tawdry venture
#

No errors, but i think the message is not being sent

sturdy oar
#

@vast jungle how did you become resource staff

#

But most importantly, when?

cerulean musk
#

guys i have a ffa server. (1.9+) but critical hits and normal hits they take the same heart. how can i fix it ?

sturdy oar
#

This doesn't happen on vanilla, maybe check your current plugins?

vast jungle
#

@sturdy oar I applied and a couple years ago

cerulean musk
#

ฤฐ can ss if you Want

sturdy oar
#

phoenix616 do you think I can become resource staff as well

jagged torrent
#

apply when md is looking for new staff and find out

vast jungle
#

we wont know until there is an application

sturdy oar
#

Oh ok so at the moment there are no recruitment open

jagged torrent
#

there's always an announcement on the forums when md looks for new staff

sturdy oar
#

Ty I'll just wait I guess

vast jungle
#

I guess nobody can stop anyone from just applying xD

lone fog
#

Do the resource staff decompile every plugin to check for malicious code

sturdy oar
#

Well

lone fog
#

Or do you have a method to narrow it down to ones that may be suspect

vast jungle
#

it is mainly based on user reports like it is on the rest of the site.

sturdy oar
#

What do the reports section look like

#

Can you show us ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘€

vast jungle
#

no, lol

sturdy oar
#

๐Ÿ‘บ ๐Ÿ‘บ ๐Ÿ‘บ Rip I will actually have to become staff and see myself

vast jungle
#

it's just your basic list of reported stuff xD

lone fog
#

50% of it is probably this plugin bad plz delete

sturdy oar
#

"anticheat no work on 1.4.7, author scam me!!!1"

wispy pewter
#

Then ask for a refund lol

bleak cipher
#

gUyS wIlL tHiS cOdE wOrK ?

public class Main extends JavaPlugin {

  @Override 
  public void onEnable() {
    Bukkit.shutdown();
  }
}
subtle blade
#

will at least prevent hackers

sinful spire
#

you wont get your server hacked if you have that

#

you need to add onDisable() tho

subtle blade
#

What for?

bold anchor
#

To start the server again

subtle blade
#

smart

wispy pewter
#

๐Ÿ˜‚

#

Infinite loop of pure fun

void hawk
#

hey guys, is there a plugin for random % drops on commands?

orchid badger
#

Is it possible to get the numeric id of an enchantment?

void hawk
subtle blade
#

Enchantment#getId() should be there, though there's no real reason to use it

sinful spire
#

why do people still use IDs

subtle blade
#

you shouldn't ;P

sinful spire
#

yeah, they dont make sense

subtle blade
#

oh there isn't a getId. probably for good reason lol

#

modern versions don't use that id. it's internal

slow grail
#

guys i dont now how to get my progect working on my server

#

this is the code

#

package me.eamonn.Heal;

import org.bukkit.Material;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Zombie;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

public void creaturespawn(CreatureSpawnEvent event) {
    
    if(event.getEntityType() == EntityType.CREEPER) {
        
        Creeper creeper = (Creeper) event.getEntity();
        
            creeper.setPowered(true);
        
        }
        
    }
    
public void creaturespawn1(CreatureSpawnEvent event) {
        
    if(event.getEntityType() == EntityType.ZOMBIE) {
            
        Zombie zombie = (Zombie) event.getEntity();
            
        zombie.getEquipment().setHelmet(new ItemStack(Material.NETHERITE_HELMET));
        zombie.getEquipment().setChestplate(new ItemStack(Material.NETHERITE_CHESTPLATE));    
        zombie.getEquipment().setLeggings(new ItemStack(Material.NETHERITE_LEGGINGS));    
        zombie.getEquipment().setBoots(new ItemStack(Material.NETHERITE_BOOTS));    
        zombie.getEquipment().setItemInMainHand(new ItemStack(Material.NETHERITE_SWORD));    
        zombie.getEquipment().setItemInOffHand(new ItemStack(Material.NETHERITE_SWORD));
        
    }

}

}

sinful spire
#

you would need to make a function that would return a id by a name lmao

#

?paste

worldly heathBOT
sinful spire
#

please

subtle blade
#

No, there's Enchantment#getByKey(NamespacedKey)

sinful spire
#

oh so there is

subtle blade
#

Hell, there's even an Enchantment#getByName(), though that's deprecated and not super accurate. Uses the poorly named values

#

emister, event listeners should be public and static and need to also be annotated with @EventHandler

#

Additionally, you need to register them

alpine yoke
#

Hey. How can I make a nice invisibility for arena spectators? So they are not visible on TAB and don't interfere with players or shooting arrows?

subtle blade
#

Player#hidePlayer() should work just fine

alpine yoke
#

p.hidePlayer(p);

#

?

subtle blade
#

Well, no. Player#hidePlayer(thePlayerYouWantToHide)

alpine yoke
#

it seems to easy

undone narwhal
#

Anyone ever played with smoothing map?

vast jungle
#

Event handlers don't really need to be static tbh.

subtle blade
#

Is the listener instance passed to the invocation? Last I recall it wasn't

vast jungle
#

Just leads to static abuse down the line

#

Pretty sure it is, how else would it call the method if its not static?

subtle blade
#

are they called if not static?

#

executor.execute(listener, event);

#

well I'll be damned

#

i've gone 6 years thinking listeners had to be static

bold anchor
#

They are eveb called if private

subtle blade
#

are you shitting me?

alpine yoke
#

how do I check if player is hidden? xd

subtle blade
#
        try {
            Method[] publicMethods = listener.getClass().getMethods();
            Method[] privateMethods = listener.getClass().getDeclaredMethods();
            methods = new HashSet<Method>(publicMethods.length + privateMethods.length, 1.0f);
            for (Method method : publicMethods) {
                methods.add(method);
            }
            for (Method method : privateMethods) {
                methods.add(method);
            }
        }
        [...]

        for (final Method method : methods) {```
well I'll be fucked...
#

TIL

orchid badger
#

I try to serialize an enchantment and it won't let me use the key as the map key in yaml because of the colon.
I'll use an array then I guess

subtle blade
#

should be able to use it just fine? wot

#

it would surround it in single quotations

orchid badger
#

Yes it works when I manually type it

#

But the library is trash lol

#

Doesn't allow me to put : rip

vast jungle
#

;D

subtle blade
#

oh okay I've never declared them as static, so idk where out of my ass I pulled that

#

though the private thing is new

vast jungle
#

lol

subtle blade
#

i'm upsetti spaghetti

vast jungle
#

making them private would probably be the best to stop other plugins from interfering with it but I've never actually seen a case where that would've been an issue so ๐Ÿคท

subtle blade
#

100% and that was always my concern

#

it doesn't happen often but they most definitely should be private to avoid it at all

broken relic
#

Hello
can someone help me
?
When i install worldedit newest version on my server, then file schematics will not create
And i want to just add one schematic on my server thats all
If someone help me with this i will be so happy guys ๐Ÿ™‚

sturdy oar
#

I think you manually have to create /schematics folder

#

Inside the WorldEdit plugin directory

broken relic
#

okay but then when i try to load that schematic i cant

#

it will write doesnt exit

#

exist*

#

but i can see that schematic in that list

#

what i have to do?

sturdy oar
#

Idk

broken relic
#

like command?

sturdy oar
#

//schem list global

#

What it says

broken relic
#

okay i just did /schematic list

#

not "//"

#

so im gonna try

#

wait

slim hemlock
#

Who pinged me

#

Huff my shorts @subtle blade

subtle blade
#

don't threaten me with a good time

slim hemlock
#

It's not a threat, it's a promise

subtle blade
#

hell yeah

wary ledge
#

ok so now i officially made it so the player cannot get rid of the item
except 2 ways

  1. you can't hotkey an item in place of it anymore but you can hotkey air
    wait so nvm
    maybe i can cancel air
    but then that would mess up anything else hotkeying air
    and 2. is death but ill figure out later
    ik there is a check for which item
    is hotkeyed
    but is there a check for which item it replaces
cerulean musk
#

Guys i Want to make Clear inventory when players do /hub. How can i make it?

broken relic
#

great i loaded schematic but other thing

#

my server crashed after that load

sturdy oar
#

Noice

#

Maybe schematic was too big and server couldn't handle it

broken relic
#

is here way how do i can load schematic in singeplayer?

mellow wave
#

WorldEdit

#

Forge

sinful spire
#

McEdit?

#

or yeah worldedit forge

broken relic
#

okay because that server is fucked up

#

xD

balmy sentinel
#

@cerulean musk when they execute hub just clear their inventory?

bold anchor
#

@vast jungle I know paper generates asm code to call them if they are public so making them private there is prolly not a good idea

subtle blade
#

sounds like a bug imo

wary ledge
#

i have the
if (event.getHotbarButton() == 8) { event.setCancelled(true); }
but it only works if it's an item trying to be hotkeyed to slot 9
not air

#

making it possible for someone to press 9 on their keyboard while over a slot with no items and it will switch

cerulean musk
#

@balmy sentinel yes

vast jungle
#

@bold anchor this is spigot, sir

bold anchor
#

Idk if spigot does it

cerulean musk
#

@balmy sentinel hub and Clear inventory :D

bold anchor
#

So i just mentioned it

balmy sentinel
#

so whatโ€™s the problem?

wary ledge
#

i am trying to make it impossible to make an item at hot bar slot 8 (9) to not leave no matter WHAT

cerulean musk
#

ฤฐf i do /hub i just go hub. ฤฐ Want to Clear inventory too

wary ledge
#

i have it so they can't place the block

#

or throw it

#

and they can't hotkey an item in it's place

#

but it's still possible to hotkey air

vast jungle
#

you are going to have to block all click and drag events with that and hope it catches everything

balmy sentinel
#

@cerulean musk just add player.getInventory().clear();

wary ledge
#

@vast jungle think the problem is it sees that it's air so it let's the event stay not realizing the air messed with the bedrock

#

because im replacing air with the bedrock

cerulean musk
#

@balmy sentinel i will TRy it thanks

vast jungle
#

@wary ledge sounds like a bug with your code tbh.

frigid ember
#

Hey guys, probably dumb question - what are scoreboard tags?

vast jungle
frigid ember
#

What are they useful for?

wary ledge
#

sorry it's so compressed i have the worst internet in the world it would take forever to upload it

#

also my recorder names everything badlion after i recorded with it once

#

here is the code

#
    @EventHandler
    public void keepItemsClick(InventoryClickEvent event) {

        final ItemStack item = event.getCurrentItem();
        if (item == null) return;
        final ItemMeta meta = item.getItemMeta();
        if (meta == null) return;

        if (event.getCurrentItem().getItemMeta().getLore() != null && event.getCurrentItem().getItemMeta().getLore().contains("ยง6Click to get moon gravity for 10s")) {
            event.setCancelled(true);

        }
        if (event.getHotbarButton() == 8) {
            event.setCancelled(true);
        }

    }```
vast jungle
#

@frigid ember adding tags to entities in order to query by them at a later date

frigid ember
#

gotchya

vast jungle
#

it's mainly for command block contraptions though, for plugins I would just use the PDC to store that date (or a database that stores the uuid)

wary ledge
#

what do servers do

vast jungle
#

you are returning when the meta is null which will be the case if its air, don't

#

(or maybe the clicked item itself is null, dunno)

#

you have to check the target item of the switch too, not just the clicked item

wary ledge
#

does this event have the target though?

vast jungle
#

yes, it gives you the target number if it's a switch click with a number key

wary ledge
#

what is it

#

event.get....

#

i havent't found it

#

nothing is showing that would make sense to be it

vast jungle
#

oh apparently I was thinking of getHotbarButton which you already use

#

so yeah, just make sure it's always cancelled, not just when clicking a non-air item

wary ledge
#

well i mean

#

some people

#

use hotkeys

vast jungle
#

yes, that's why you need to cancel it if it would modify your item

wary ledge
#

so just cancel all hotkeys

#

well i mean

#

why doesn't the hotkey thing work if it's air

#

like it fixed the item to item switch

vast jungle
#

because you return when its air

#

and no, as I said: simply only cancel when your hotkey is targetting the slot that your custom item is in

wary ledge
#

oh

#

@vast jungle but how do I check that

#

The target slot

vast jungle
#

it's the number of getHotbarButton

wary ledge
#

I already have a thing to cancel hotbar 9

#

But air bypasses it

vast jungle
#

as I already said multiple times: your code only cancels when you click an item, if you click air it returns at the start of your listener method

wary ledge
#

So I need to out the hotbar thing over the returns

vast jungle
#

yeah

worldly heathBOT
vital copper
#
at me.Lorenzo0111.Souls.Souls.onCommand(Souls.java:36) ~[?:?]```
#

Line 36, of Souls.java

rigid nacelle
#

By repl.

ember bay
#

Currently i'm working on an SMP Server for 1.14.4, but for some reason there's a bug where your own skin appears as a steve, but other people look normal. For example, you in F5 would look like a steve, but to other people you have your normal skin. Any known solutions?

I went through my plugins that could mess with skins, but I also tried to look for plugins to solve this as well

#

however if I use a skin plugin to change my skin, it just resets when I rejoin

bold anchor
#

Don't play 1.14.4 why are you doing this to yourself?

dreamy glacier
#

Hello guys , how i can check if an entity with custom name is already spawn in my world ?

bold anchor
#

get all entities and loop over them and check for the name

hardy cedar
#

is there is a way to create a function in onCommand thing? ๐Ÿค” ๐Ÿง 

#

answer is :"idts" right? :/

pseudo crown
#

what do you mean ?

dreamy glacier
#

ok thx

nova badge
#

suppose I have a lot of implementations of a single event, say EntityDamageEvent. Is it better to listen to this one time in a single class, or listen to it multiple times (around 20) in different classes?

glossy summit
#

does anyone know much about luckperms plugin?

hardy cedar
bold anchor
#

Ayush, most likely one time since events are fired with reflection which might lead to a small performance decrease if you listen to it 20 times when you can just listen to it once.

nova badge
#

so a single class with ~500 lines of code rather than 20 classes with few lines of code

#

right?

bold anchor
#

You know you can parse the events around right?

nova badge
#

can you explain?

bold anchor
#

Hmm sec

nova badge
#

sure, thanks a lot!

glossy summit
#

i need some help with luckperms anyone able to help?

bold anchor
#

Go ask on the luckperms discord jackie.

glossy summit
#

ok

pseudo crown
#

@hardy cedar do you know what contructors are ?

shy valve
#

As i download buildtools 1.15.2?

hardy cedar
#

@hardy cedar do you know what contructors are ?
@pseudo crown no lol

shy valve
#

Help plis :c

sturdy oar
#

Whats the issue

pseudo crown
shy valve
#

Thanks @pseudo crown

hardy cedar
#

so is there a way to fix my problem :/

#

?

pseudo crown
#

@hardy cedar you can't just create a method to get your player object in onCommand class because every time a player types the command there's a new instance of the class (so all the variables are different)

#

what exactly are you trying to do

hardy cedar
#

i want to ban the player when the admin clicks on a specific Item

#
    public void onClick(InventoryClickEvent e) {
        Player p = (Player) e.getWhoClicked();
        if (e.getInventory().getName().contains("Reaping") && p.hasPermission("GraveMC.Punish")) {
            e.setCancelled(true);
            if (e.getCurrentItem().getType() != Material.AIR) {
                if (e.getCurrentItem().isSimilar(SevenDaysBan)) {
                    p.performCommand("ban ");
                    p.closeInventory();
                } else if (e.getCurrentItem().isSimilar(MonthBan)){
                    p.closeInventory();
                } else if (e.getCurrentItem().isSimilar(YearBan)){
                    p.closeInventory();
                }
            }
        }
    }```
#

i need to perform ban command with the target name

pseudo crown
#

you can use Bukkit.getPlayer(name) and check if it's not null, if it isn't then you can store it; example: ```Java
Player playerToBan = Bukkit.getPlayer(Notch);
if (playerToBan != null) {
// ban the player
}

#

and if the player types /ban <player> the <player> would be on args[1] which means you can just do Bukkit.getPlayer(args[1]);

hardy cedar
#

how can i get that in other class

#

??

pseudo crown
#

Constructors

hardy cedar
#

can u give a example code pls :/

frigid ember
#

yes

#

MyClass cls = new MyClass();
cls.callFunction();

bold anchor
fierce briar
#

โ€œOnshitโ€ and โ€œonPoopโ€ ๐Ÿ˜‚๐Ÿคฃ Dead and I donโ€™t code

hardy cedar
#

yes
@frigid ember there IS NO Function to call

#

:/

frigid ember
#

make the function ten

#

then

nova badge
#

@bold anchor, thanks I will take a look.

grizzled remnant
#

@bold anchor i lost brain cells reading that example

bold anchor
#

Thx โค๏ธ

pseudo crown
#

@hardy cedar you need to use constructors

#

it creates a new instance (version) of the class every time the command is run so having a function to "get the name" from the class will return nothing.

ionic hound
#

what would i do to put the first arg on a command into a verial

bold anchor
#

You would type String argZero = args[0];

ionic hound
#

i can not spell

pseudo crown
#

computers count from 0, and the arguments are stored in an array, so array[0] gets the first argument (if there are any).

ionic hound
#

i understand that

lone fog
#

In most languages that is

ionic hound
#

why does it put a 1 In front of it?

bold anchor
#

?

ionic hound
#

ow shit i just put a one an accident

vast arch
#

@ me if you respond

sand fjord
#

Hi there, sorry if this is a common topic but do vanilla chunk loaders not work in spigot? Moved my world over to a spigot server and now it seems there are certain things that dont work. Had a chunk loader at the bottom of map below my villager farms that are on surface area, the loader is still running when i come back, but never any production from the villagers.

#

Or do chunk loaders also have a limit in the vertical range of what they would affect?

#

Is this something I would need to adjust in Spigot.yml?

odd knoll
#

@vast arch try update shopgui+. You're nearly 2 years out of date.

bold anchor
#

@vast arch I'd assume the plugin failed to load something from the config and did not get enabled and therefore just completed fucked itself.

#

Idk anything about the issue tho i'm just guessing

vast arch
#

@odd knoll not the problem

#

@bold anchor I don't think that's the problem as it worked once then failed the next, but maybe.

lime harness
#

anyone have any clue where the sorting code for the playerlist is located?

#

im looking in nms

#

specifically the playerlist class i cant seem to find anything that orders them by name.

hardy cedar
#

[iiAhmedYT: Banned player CraftPlayer{name=iiAhmedYT}] shit :/

frigid ember
#

I have a server which tries to replicate "Tekkit" stuff, like conveyors, batteries, drills and some other technic stuff.
But I came to a problem. Chunks would have to be loaded whenever player places some block which has to tick every n-th ticks. Chunks being loaded takes away a lot of resources. I need to somehow disable some stuff.
What kind of solution would be the best? I have some ideas:

  1. Disable those machines/blocks when player leaves.
  2. Disable machines/blocks if the distance is too big. Might be problematic to implement if one chunk would transfer items to other chunk in a loop, one chunk loading other chunk and etc.
  3. Force player to click on a block (like power generator/battery) to make it continue working, for example those blocks could be broken unless fixed with a wrench.

Anyone got any other ideas? o_o

vast arch
mellow wave
#

@frigid ember Normal modded machines turn off when the chunk is being unloaded. As for transfering items I'm not sure. Forcibly making people click on a generator to make it keep working is also quite easy if you listen to the PlayerInteractEvent and force an arm swing animation.

ionic hound
#

I have a argument that i want to make sure is set what would i do to make it check

mellow wave
#

I mean check if it isn't null

#

And that the length of args is long enough

pseudo crown
#

if (args[i] != null) ๐Ÿ™‚

#

as Olivo said do a null check

jagged torrent
#

that will never be null

#

if you're talking about a command's argument array that is

mellow wave
#

Yeah it will throw an ArraysOutOfBoundsExeption

#

If it doesn't exist

pseudo crown
#

oh shit yeah mb

#

first args.length then args[i] ๐Ÿ˜›

acoustic temple
#

Is there any way to make players in spectator mode appear as normal players in the tab list?

frigid ember
#

why doesnt my essentials nickname show up on my player tag? it comes up in chat and in tab but not tag :(

mellow wave
#

You need another plugin to display it elsewhere

#

Wait wdym tag?

pseudo crown
#

i think name above the head..

mellow wave
#

If you mean above your head you need another plugin

pseudo crown
#

that shit is hard to do honestly

frigid ember
#

the nametag

#

i the TAB plugin

#

and this is in the config
OTHER:
tabprefix: '%luckperms_prefix%'
tagprefix: '%luckperms_prefix%'
tabsuffix: '%afk%'
tagsuffix: '%afk%'
customtabname: '%essentialsnick%'
customtagname: '%essentialsnick%'

shy valve
#

how i can download the 1.15.2?

mellow wave
#

Use buildtools

frigid ember
#

me?

mellow wave
#

no

shy valve
#

ok

mellow wave
#

That's not a valid PAPI placeholder. Is it a valid TAB plugin one?

frigid ember
#

idk

#

no but

#

customtabname: '%essentialsnick%' works

shy valve
#

how can I use buildtools to download 1.15.2 is for a server

frigid ember
#

If you mean above your head you need another plugin
@mellow wave what plugin

shy valve
#

???

mellow wave
#

TAB works

#

You already have it

pseudo crown
frigid ember
#

yes but tag doesnt

shy valve
#

I already downloaded this but I don't know how to use it

frigid ember
#

the customtagname: '%essentialsnick%' doesnt work

pseudo crown
#

then i can't help someone who isn't willing to read what i posted

shy valve
#

:c

mellow wave
#

@shy valve Read what the link says :/

frigid ember
#

woki

#

wiki

shy valve
#

Sorry but I'm new to this, I have no idea of โ€‹โ€‹anything

mellow wave
#

@frigid ember What version of spigot and essentials are you using?

frigid ember
#

1.16

mellow wave
#

You're new to reading? jk...

frigid ember
#

.12

#

oop

#

.1

shy valve
#

.__.

mellow wave
#

And the essentials version?

frigid ember
#

umm

#

2.18.0.0

mellow wave
#

Is that essentialsx or some other fork

hybrid path
#

permissions.yml is a native spigot/bukkit thing right? Where is the documentation for it, cause I can't find anything "new"?

frigid ember
#

yes

shy valve
#

What is the link to download Git?

#

๐Ÿ˜›

mellow wave
#

It will get it for you

shy valve
#

aAAA

#

ok

mellow wave
#

Just run the command in a bat file

shy valve
#

o thanks

mellow wave
#

(if you're on windows)

shy valve
#

Yes i use windows

mellow wave
#

Yes

#

I think it can show ram

#

Not sure

#

That sounds like CPU not ram

#

But it can be caused by ram too

#

Alright send your timings

frigid ember
#

?

ionic hound
#

I am trying to check if an arg is set. My code is: if (args[0] != null){
But it only works if i put null how do i fix this?

mellow wave
#

Do this: if (args.length > 1)

frigid ember
#

Length?

mellow wave
#

length checks the amount of arguments

#

Since it's stored in an array

frigid ember
#

I think you should do what Olivo said. Args.length should show how many arguments

#

You know what

#

Imma stop talking

#

thanks

sleek ivy
#

is there anything in bukkit/spigot that prevents enable-query/query.port from working? I set it true, changed the port, enabled my firewall, but every tool i try can't read it

bronze acorn
#

are you using a panel

#

@sleek ivy

sleek ivy
#

no

bronze acorn
#

did you portforward that port ?

sleek ivy
#

I'm trying it locally

#

there's no portforward needed anyway it's on an ubuntu server in a datacenter

frigid ember
#

How can I check a player's village reputation? I have tried using NBTExplorer but I don't know what file it is stored in.

#

?paste

#

!paste

#

um

#

what is the command?

worldly heathBOT
frigid ember
#

oh ok

#

weird

#

It gets fromyaml test: test: test: text

#

to yaml test: test: {}

#

the resource config doesn't contain any of this keys

#

can someone please help me?

vast jungle
#

I assume you are passing test.test.test to the set method? If so it will only remove that key, you need to set the parent keys null too if you want to remove them

frigid ember
#

yes

#

im iterating through them

#

Ah i think you need to console log too

#
[22:10:48 INFO] [BungeeStatus]: [motd.text, motd.activated, motd, icons.activated, icons, protocol.text, protocol.activated, protocol, max, overridemax, online, overrideonline, playercounter.text, playercounter.activated, playercounter]
[22:10:48 INFO] [BungeeStatus]: [test.test.test, test.test, test, max, motd.text, motd.activated, motd, icons.activated, icons, protocol.text, protocol.activated, protocol, overridemax, online, overrideonline, playercounter.text, playercounter.activated, playercounter]
[22:10:48 INFO] [BungeeStatus]: The template config doesn't contain test.test.test
[22:10:48 INFO] [BungeeStatus]: Setting it to null```
#

then the other on enable stuff happens

#

not related

#

i reversed the list because it started with test

#

and then iterated through test.test

#

and the other stuff

#

what

#

weird behaviour

#

i logged all entries

#

and i got this:

#
[22:36:12 INFO] [BungeeStatus]: The template config doesn't contain test.test
[22:36:12 INFO] [BungeeStatus]: Setting it to null
[22:36:12 INFO] [BungeeStatus]: test```
#

why does it think test is included in the temolate?

#

How can I check a player's village reputation? I have tried using NBTExplorer but I don't know what file it is stored in. This is on a server, not singleplayer

wanton delta
#

should potioneffecttype use .equals or ==

hybrid path
#

What's the best way to define a default config.yml and have it in plugins/plugin/?

subtle blade
#

by creating a config.yml ๐Ÿ˜›

hybrid path
#

Well duh. But I see a lot of plugins that when used first time automatically drop a default config.yml into their plugin data folder.

subtle blade
#

Yeah you can call JavaPlugin#saveDefaultConfig()

#

Does that all for you

hybrid path
#

Where does it pull the data from?

subtle blade
#

the config.yml you made in your plugin

hybrid path
#

in resources?

subtle blade
#

yeah

#

or wherever your plugin.yml is

hybrid path
#

oh, that explains a lot

dreamy forge
#

Hey, I've coded a factions plugin for the 1.15. But now I've decided to make it support 1.8-1.16. Its already a huge plugin. Is there anyone who can explain me how I can do this? Please DM me :))

nova kite
#

hey!

#

i need help

#

wait

#

i cant paste screenshots in here

frigid ember
#

?paste

worldly heathBOT
bold anchor
#

?verify

#

@nova kite

nova kite
#

i cant seem to get the package in the package

warped coyote
#

I just did try{//new method}catch (MethodNotFound e){//Do deprecated method}

#

Yet again

frigid ember
#

i cant seem to get the package in the package
@nova kite no. Your Main class just has errors

#

and you need to adress them

nova kite
#

ok

peak marten
#

Does anyone have an idea on how to prevent an enderman from teleporting except if the teleport is caused by the plugin itself?

frigid ember
#

@nova kite read it

nova kite
#

ok

frigid ember
#

it says what the issue is

mellow wave
peak marten
#

@mellow wave , it doesn't have a teleport cause

mellow wave
#

Yeah no other event

nova kite
frigid ember
#

yes it contains it

#

read it again

nova kite
#

ok

peak marten
#

@nova kite , put it in the src folder instead

nova kite
#

oh

mellow wave
#

@peak marten A work around for this is to store the entity UUID and ignore the next teleport event with it

peak marten
#

@mellow wave , thats the issue. I need to detect if the teleport was done by the plugin

#

hmm

#

no, because I still can't see when to cancel it

#

the enderman may not naturally teleport away, but will be teleported by the plugin

mellow wave
#

Why don't you want it to teleport?

#

If you don't want it to do anything disable it's AI

peak marten
#

I don't want to disable the AI? it still has to wander around, just preventing the teleport

#

the natural teleport

mellow wave
#

Alright then

#

Anyway the approach I suggested is probably the easiest for you to use

frigid ember
#

@nova kite as far as ik it needs to be in the project folder and not in the src or a package

peak marten
#

@mellow wave , I wish it was, but unfortunately, if the teleport event is also triggered when the plugin teleports the entity, then it won't work

#

unless.... it doesn't trigger when the plugin teleports the entity, then there never was a problem at all lol

mellow wave
#

I told you to ignore the event if you teleported the entity

#

That's not hard to do

peak marten
#

I don't think you understand my use case. If I cancel it when I teleport it, that will result in nothing at all

nova kite
#

omg im dumb

#

sorry

peak marten
#

anyhow, most likely, there is no issue

#

becaue the documentation say's:

Thrown when a non-player entity is teleported from one location to another.
This may be as a result of natural causes (Enderman, Shulker), pathfinding (Wolf), or commands (/teleport).
nova kite
#

i didnt capitalise my thing

mellow wave
#

No that's not what I mean. I understand that you want to cancel all non plugin teleportation

peak marten
#

Yes

#

Most likely there is no issue lol

mellow wave
#

You can detect if your plugin caused the teleportation by storing the UUID and not cancelling the event if it matches that UUID

#

It's not hard

peak marten
#

Not if the event is not making a differencation between teleports done by the plugin, and by natural

#

Anyhow

#

I don't think there was a problem at all

#

As I just noticed, the event will only trigger for the below mentioned:
Thrown when a non-player entity is teleported from one location to another.
This may be as a result of natural causes (Enderman, Shulker), pathfinding (Wolf), or commands (/teleport).

#

It doesn't mention other plugins

mellow wave
#

You don't seem to understand what I'm saying

#

It doesn't matter if the event makes any difference between natural or plugin teleportation

peak marten
#

nevermind lol

#

it does, because if the plugin is teleporting it, even though I know if it is that specific entity, it (might) still execute the EntityTeleportEvent

#

if that is not the case, then I don't have an issue

#

If it does, then there is NO way to prevent this

mellow wave
#

Why do you need to prevent the event

peak marten
#

because I want to cancel the teleportation

#

but ONLY if the teleport is caused by natural behavior

mellow wave
#

Yeah and I see no issues with my method. Would you please explain the problem that you're seeing with it?

peak marten
#

Okay, explain the code then how you would do it

#

Because I don't know how you would solve that

#

I'm very familair with events

#

most likely there is no issue, but I'm curious now

mellow wave
#
  1. Add the entities UUID to a list
  2. Force the teleportation
  3. The EntityTeleportationEvent will now fire (I'm asuming it does, I have no way of testing it atm)
  4. In your listener class you can do nothing if the entity has it's UUID in the list
  5. Remove the UUID from the list

If a natural teleportation occurs it will not have the entity UUID in the list allowing you to cancel the event

peak marten
#

I'm still missing your logic

#

Let's say the following:

#

Enderman is stored in hashmap with UUID

mellow wave
#

Yeah I'm really tierd and I'm probably missing something then

peak marten
#

The enderman is naturally teleporting

#

what do you do?

#

the event fires

#

you cancel right?

mellow wave
#

It will never be in the list if it's natural

peak marten
#

lol

#

And why not? How did it get added to the list in the first place then?

mellow wave
#

It's all handled on a single thread meaning that it will be executed in order

#

Which means that it can't be in the list unless you add it just before you force teleport

#

And then you remove it after the event is fired

peak marten
#

Lol, you mean to add the UUID to the list right before you teleport the entity?

#

then check if it is in the list

#

if it is, don't cancel

mellow wave
#

Yes

#

Exactly

peak marten
#

then remove

mellow wave
#

Probably not the best approach but that's what I could think of

peak marten
#

Okay lol, something I really didn't think about, goes very far, but would indeed be a solution

#

But most likely, the event won't fire

#

Well, thank you for keeping up, for just a slight moment, I thought you had no idea what you were talking about :p

#

But then you mentioned the It's all in synchronous order

#

Then I understood

#

So my apologies for that

mellow wave
#

Yeah sorry for confusing you

peak marten
#

Well, really something I wouldn't even use, but definitely a solution

#

Interesting though

mellow wave
#

It's almost mid night and I should get some sleep :/

peak marten
#

same here

#

But not going to sleep yet

#

There is heatwave going on here

mellow wave
#

Yeah I'm used to thinking about weird work arounds

peak marten
#

I want to open the windows

mellow wave
#

They usually work but may cause unintended issues

peak marten
#

ah well, I'll let you know in private if you want if the teleport thing worked

mellow wave
#

Alright send me a dm and I'll respond as soon as I can

peak marten
#

Most likely not for today, or I might actually, you'll see

mellow wave
#

I mean it's 15 minutes left of today here so if you want to make it you need to hurry up

peak marten
#

oh okay lol

mellow wave
#

Yeah dw it doesn't matter when

peak marten
#

perfect ๐Ÿ™‚

#

So for all of you to know. and @mellow wave , the EntityTeleportEvent is not getting triggered when caused by the plugin

#

so just perfect ๐Ÿ™‚

#

the enerman is no longer teleporting

mellow wave
#

Alright that's perfect :)

peak marten
#

Just tested with some water

ionic hound
#

could some one help me think something through in a vc?

peak marten
#

What is your question about?

ionic hound
#

a plugin i am coding

peak marten
#

If people were not sleeping here, I could help you in vc, now it has to be text

ionic hound
empty seal
#

If people were not sleeping here, I could help you in vc, now it has to be text
@peak marten Wdym?

peak marten
#

@empty seal , it's mid night here. I can't speak in voice chat

#

Oh I see. @ionic hound , what does your debugger say?

#

your IDE

ionic hound
#

java: missing return statement

empty seal
#

Ah. I thought you meant in the server.

peak marten
#

Okay, so you got a method that returns something. And in that method , you are missing the return

ionic hound
#

i understand that i have been staring at this for 10 min trying to find the missing the return

peak marten
#

Okay, but it should mention the line number

ionic hound
#

yes 305

peak marten
#

Okay, let me check

#

Oh, I see ๐Ÿ™‚

#

@ionic hound , add on line 304

 return true;
ionic hound
#

now i feel dumb

nova kite
#

i do not understand this error

bold anchor
#

Itโ€™s null

#

Something is null

nova kite
#

ok lemme check

#

ty

#

i realised what i did

frigid ember
#

Hello, i am having a problem on my server where my members who are not op cannot destroy or place blocks, use items, eat, and chat only shows up in dynmap not on the server chat.

#

Is anyone else having this problem? btw I have Essentials, Towny, Luckperms, and dynmap installed

celest current
#

?paste

worldly heathBOT
celest current
#
                player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 200, 2, true));
            }```
#

Line 42 is the if statement. What's the issue with it?

hoary cove
#

hello guys please help me with this plugin

#

Website Host [No More Support] 2.0

lapis plinth
#

Caused by: java.lang.IllegalArgumentException: Cannot make player fly if getAllowFlight() is false

How to make this true?

celest current
#

Caused by: java.lang.IllegalArgumentException: Cannot make player fly if getAllowFlight() is false

How to make this true?
@lapis plinth player.setAllowFlight(true);

lapis plinth
#

kk

ionic hound
#

How would i see if a arg has a permission. I have tried
if (args.hasPermission ) {

celest current
#
  //Code stuffs
}```
#

that what I use for mine lmao

#

change the perm to pluginname.perm

ionic hound
#

i want to see if arg0 (player) has a permission

lone fog
#

Bukkit.getPlayer()

ionic hound
#

what would i put if (this spot> .hasPermission("Gui.punish") {

lone fog
#

Bukkit.getPlayer()
@lone fog

#

Look up the syntax on the java docs

#

Though itโ€™s pretty self explanatory

spare tiger
#

im currently making a hard decision

#

should my plugin version on maven be 0.1.0-SNAPSHOT or 1.0.0b1-SNAPSHOT

#

They mean the same thing, but they imply very different things

#

1.0.0b1 means I'm not making very many non backwards compatible changes

#

once I release 1.0.0b1 there's no going back for b2

#

0.1.0 says hey anythingcould change at this point

#

and of course it is SNAPSHOT

#

but I'm just not sure

hoary cove
#

@spare tiger please help

#

Host a Website using Bukkit! is this will work on my spiggot server?

#

i already downloaded the git and export to jar

#

when i run the server it doesnt generate a folder

spare tiger
#

im gonna behonest

#

i have no idea

#

never used that plugin before

#

wait you downloaded the git and export to jar?

#

what does that mean

#

@hoary cove did you build the jar or did you just make it into a zip file and rename it to .jar

#

you have to actually build it

#

@frigid ember this would still apply if I was using gradle

#

hmpf

hoary cove
#

i downloaded the gits

#

and then

#

import to my eclipse

#

then export to jar

ionic hound
#

if i don't register a command can i still run it?

#

how would i hide a command so you can still see it but you still can run it?

#

how would i run a command as op i know it is not the best thing to do

midnight void
#

Heyo! So I got a weird scenario going on here. I'm running a Discord bot on a plugin making it so I can run commands from discord as the console. This works all the way from 1.8 to 1.12.2 but as soon as I go to 1.13 or higher it doesn't work. I can confirm that there is still a connection from discord to the server with the bot but for some reason I'm not able to dispatch any command. Any idea what the issue here might be? Google doesn't seem to be helping much

    @Override
    public void onMessageReceived(MessageReceivedEvent e) {
        if(e.getAuthor().isBot()) {
            return;
        }

        fm.loadConfigFile();
        if(fm.getConfig().getLong("Important.ChannelID") == e.getChannel().getIdLong()) {
            Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), e.getMessage().getContentRaw());
        }
    }
#

Also, no errors. It's as if it reaches dispatchCommand and absolutely nothing happens. The code simply stops there. I tried putting a debug message in the lines above and below that and only the top one got sent in the console

spare tiger
#

technically you can run a command without registering it

#

by using AsyncPlayerChatEvent

#

but that's just dumb

#

just register the commands

frigid ember
#

anyone knwo a plugin like staff essentials but for 1.16

ionic hound
#

how would i run a command as op i know it is not the best thing to do

frigid ember
#

idk

winged sparrow
#

@ionic hound The only real way to do that is to give the user that permission, run the command, and then remove it

#

Or op the player, run the command, and deop

#

which is HIGHLY unsafe

frigid ember
#

sudo?

winged sparrow
#

what?

frigid ember
#

/sudo?

#

you run it for them?

winged sparrow
#

that's an essentials command and all it does is force the player to run a command

#

it does not ignore permissions

frigid ember
#

k

hybrid path
#

is there like some kind of event when a hopper tries pulling a item from a block?

ionic hound
winged sparrow
#

I haven't looked at that plugin's code

#

@hybrid path Think there's one maybe called InventoryMoveEvent

#

let me check

hybrid path
#

Hmm thanks
I'll look if that works here.

winged sparrow
#

I don't know, I haven't looked at it. I think it's unsafe.

#

I'm not looking at it right now

#

Sure, but not now

#

But I think the only way it's possible at all, if the command requires a permission the player doesn't have, it is unsafe

#

If it just forces the player to run a command for a permission they have, then no it's not unsafe

#

Oh, that's nothing dangerous

#

If it's just making the console run commands, no, it's not dangerous

#

if it's forcing a player to run the command as themself

#

then it's dangerous

ionic hound
#

what would i do to check if a player is op?

keen compass
#

Player.isOp()

ionic hound
#

does not work

#

if (player.isop()) {

winged sparrow
#

Bukkit.dispatchCommand(u, input); is all it does to execute the command @tranquil edge

ionic hound
#

@keen compass

keen compass
#

I don't have my IDE opened up, but it is under the permissable stuff @ionic hound

winged sparrow
#

Yes, I decompiled it. That's for you to decide, that's the method it uses. I've never really messed with forcing players to dispatch commands so maybe read the documentation for that method

keen compass
#

but you spelt it wrong

#

it is
Player.isOp()

#

it does exist as well

#

just looked at the javadocs

#

player is a subinterface of that

winged sparrow
#

I don't see why it isn't safe

#

So I would assume it's safe

#

It doesn't appear to op the player or manipulate permissions

keen compass
#

dispatch command depending which sender you choose to use, doesn't add permissions. It runs the command as that player or object

#

so if the player doesn't have perms it will fail

winged sparrow
#

That's what I assumed.

keen compass
#

conversely you can run the command as console instead in which case it should succeed unless there is something wrong with the command being ran

#

also the command has to be a registered command as well

#

or something listening to intercept said command if not registered

#

I recommend sticking with running the command as the player instead however

#

this prevents a way to circumvent some protections by exploiting your bot from discord side ๐Ÿ˜‰

winged sparrow
#

Are we talking to the same person? lol

keen compass
#

yes, just we happen to be discussing the idea albeit without that person responding ๐Ÿ˜›

#

at leat I am pretty sure we are

#

only person I recall asking about running commands was the one who needed help with their discord bot not running commands? o.O

#

in either case I am sure for anyone else it might answer their questions to XD

winged sparrow
#

I was talking in response to the non dev guy about how a particular sudo plugin works but I guess it's on the same topic lol

#

I just got confused there haha

keen compass
#

ah right the sudo command from essentials

#

sudo command operates on the same principles since it uses strictly the API

#

the exception is if you force the sudo command to run as console which is highly not recommended

#

that plugin works the same way as well

#

hardly expect a 6kb plugin to be using some kind of reflection

ionic hound
#

Why can i not compare a player to an arg:
Player player = (Player) sender;
if(player = args[1])

quick arch
#

Because one's not a player ๐Ÿ˜

keen compass
#

because player is a reference to the Player object, and args[1] is a string reference to an argument in the command

#

what you need to do is get the player name from the player object which is a string

ionic hound
#

so how would i make it work?

keen compass
#

player.getName().equalsIgnoreCase(args[1]) { }

#

might want to make sure args[1] exists first though

#

otherwise you end up with an NPE

subtle blade
#

or just guess Kappa

#

maybe it'll throw an exception, maybe it won't

#

that's just part of the fun!

keen compass
#

lol

winged sparrow
#

exceptions just show that the code is working

subtle blade
#

exactly! at least you know it's getting called

keen compass
#

or not getting called if its the wrong exception then what you were expecting

winged sparrow
#

Shhh

keen compass
#

you know those funny exceptions that obscure everything because they don't really point to what exactly is the problem only that there is one XD

low citrus
#

hey so i have both java 11 and 14 on my path-
how do i specify which version to use for javac (ping plz)

hoary cove
#

hello i have a question

dusty topaz
#

hello person who has a question

atomic nova
#

so i know you can make a custom item but are you able to make like custom blocks ? just wonder i have been trying to make a custom block based off Diamond Block

quick arch
#

yes, but there are setbacks

keen compass
#

@low citrus you can only have one java home set, if some how you managed to have 2, then its which ever directory is first

quick arch
#
  1. 160 unused mushroom block states
    Potentially the best one, but problem with them is some other plugins may be already using them, so conflicts can happen

  2. Armor stand custom blocks
    The problem with them is the server has to do more stuff, because they are entities

  3. Spawner custom block
    The problem with them is the client has to render the spawner, reducing frames for the players that are near them

keen compass
#

you could make the spawners invisible

quick arch
#

๐Ÿค”

#

nms?

#

also, wouldn't they still render it

hoary cove
#

hello paper server used spiggot plugins is allowed?

keen compass
#

yes, but the amount of nms is very minimal

quick arch
#

ooh

keen compass
#

basically just need to hide it from the client

quick arch
#

How does that work