#help-archived

1 messages · Page 52 of 1

median wing
#

Yah

sacred wave
#

@remote socket oh sorry didn't know that... then I suggest you try it, or if you want to be sure, you can always use String#toLowercase

median wing
#

The thing with it is the breaking of 3X3X1 works in almost all directions a player is facing l, but when direction of rotation starts to be negative like SouthEast, it doesn't run the event.

#

And gives me this error

sacred wave
#

if it does not run the event, the this code should not be executed at all?

median wing
#

The event is supposed to look at which direction you're facing and mine in a 3x3x1 direction whichever way you look

#

It's a pickaxe tool

#

That you get with a cmd

sacred wave
#

I get it, only thing I don't get, what is null in there, as if it was super_pickaxe, it would crash at the top of the code... if it was dirblock, it should crash on the assert...

median wing
#

So what do you think I should do?

sacred wave
#

if you can debug, I would suggest placing breakpoint in the for and try looking on what is null, if not, try outputting all the variables and subsequent calls in that for into console...

median wing
#

Alright thank you, I'll try that!

sacred wave
#

if that doesn't help, share what have you outputted and outputs themselves...

median wing
#

Only thing is, the console points the errir in the dirblock.getRelative(x, 0, z).breakNaturally(explosive_pickaxe);

#

So Idk if something should be changed in there

sacred wave
#

i would output dirblock, dirblock.getRelative(x, 0, z) and explosive_pickaxe

bronze horizon
#

Where is dirblock set?

median wing
#

Block dirblock =null;

bronze horizon
#

well its null

sacred wave
#

yea but under that there are bunch of ifs, which do set it...

median wing
#

I know, I'm pointing it to all directions

sacred wave
#

but what is also possible that the assert is caught somewhere, so it is null in the ned...

bronze horizon
#

are those within an if condition

#

the things that change it from null

remote socket
#

I'm forking a plugin, and they used Settings.blockValues.containsKey(md), I would like to check if the cs.getSpawnedType() is in the config. If i add PIG_ZOMBIE for example should it work if I just do Settings.blockValues.containsKey(cs.getSpawnedType())

median wing
#

Yah they are @bronze horizon

bronze horizon
#

so what if that doesn't run

sacred wave
#

@bronze horizon yes, it can possible be null, what confuses me is that he has assert dirblock != null above that... it should fail on that, shouldn't it?

median wing
#

But I put that there to not null the getRelative

bronze horizon
#

if it's failing on the dirblock method then it isnt right

#

can i see your code?

#

where you set dirblock

#

please

median wing
#

Sure

bronze horizon
#

thanks

median wing
bronze horizon
#

alright

#

it will set dirblock to something wherever a player is facing

#

BUT

#

what if that relative block is empty?

#

then it's null, right?

sacred wave
#

it should be AIR, then, shouldn't it?

bronze horizon
#

oh

#

maybe

sacred wave
#

well getRelative cannot return null...

median wing
#

Where inn my code ?

sacred wave
#

try the debug outputs...

median wing
#

Set AIR to what?

sacred wave
#

use Bukkit.getLogger().info(...)

#

@median wing nothing, he was talking if player was looking into nothing it would return null, but it should return AIR

median wing
#

Ah

bronze horizon
#

where is block defined?

#

not dirblock just block

sacred wave
#

doesn't matter, it would crash as soon as block.anything is called....

bronze horizon
#

good point

paper compass
#

How can i set an armorstands head pose to face the player?

bronze horizon
#

duck im doing some tests gimme a sec

pure pasture
#

How do you get if an item was clicked in the normal inventory?

median wing
#

Still can't figure why it;s doing that, hmmm?!

dapper coral
#

Can someone tell me how to get "discord": with

https.get(`https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=${args[0]}`, async res => {
  res.on('data', d => {

    if(d.identities.discord == message.author.tag) {

      message.member.roles.add(message.guild.roles.cache.find(r => r.name.toLowerCase() == 'verified').id);
      message.reply('Successfully verified your account!');
    
    } else message.reply('Invalid Discord!\nMake sure to put your Discord Tag under your profile!');

  });
});

d = {"id":"642407","username":"SpokenWig620933","resource_count":"0","identities":{"discord":"RedstoneGamer#4122","youtube":"Redstone Gamer123"},"avatar":{"info":"1557348459","hash":""}}

Im using https://github.com/SpigotMC/XenforoResourceManagerAPI with the getAuthor method.

bronze marten
#

d.identities.discord should work?

dapper coral
#

nope

#

undefined

#

identities is undefined throwing an error about discord

bronze marten
#

var data = JSON.parse(d)

#

then try it on data

remote socket
#

I'm new to spigot. Tried to fork ASkyBlock and theres a lotta errors when trying to compile that are unrelated to my small chance.

#
Some problems were encountered while building the effective model for com.wasteofplastic:askyblock:jar:3.0.9.4
'dependencies.dependency.version' for net.milkbowl.vault:VaultAPI:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 101, column 13
'dependencies.dependency.version' for com.sk89q:worldguard:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 106, column 13
'dependencies.dependency.systemPath' for com.songoda:UltimateStacker:jar should not point at files within the project directory, ${project.basedir}/dependencies/UltimateStacker-1.11.10.jar will be unresolvable by dependent projects @ line 121, column 16
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
#

Can anybody assist me?

bronze horizon
#

@median wing is this code you gave me in an on mine method?

#

like block break

dapper coral
#

Thanks @bronze marten That worked amazingly!

median wing
#

@bronze horizon yah BlockBreakEvent

bronze horizon
#

ok

#

is the variable block

#

the block broken?

median wing
#

yah

bronze horizon
#

got it

#

i think i fixed it

median wing
#

Block block = e.getBlock()

bronze horizon
#

ill send you the code you try it ok?

median wing
#

ok

bronze horizon
#
        double rotation = Math.abs((player.getLocation().getYaw()) % 360);
        if (0 <= rotation && rotation < 22.5) {
            player.sendMessage("South");
            dirblock = block.getRelative(BlockFace.SOUTH);
        } else if (22.5 <= rotation && rotation < 67.5) {
            player.sendMessage("SouthWest");
            dirblock = block.getRelative(BlockFace.SOUTH_WEST);
        } else if (67.5 <= rotation && rotation < 112.5) {
            player.sendMessage("West");
            dirblock = block.getRelative(BlockFace.WEST);
        } else if (112.5 <= rotation && rotation < 157.5) {
            player.sendMessage("NorthWest");
            dirblock = block.getRelative(BlockFace.NORTH_WEST);
        } else if (157.5 <= rotation && rotation < 202.5) {
            player.sendMessage("North");
            dirblock = block.getRelative(BlockFace.NORTH);
        } else if (202.5 <= rotation && rotation < 247.5) {
            player.sendMessage("NorthEast");
            dirblock = block.getRelative(BlockFace.NORTH_EAST);
        } else if (247.5 <= rotation && rotation < 292.5) {
            player.sendMessage("East");
            dirblock = block.getRelative(BlockFace.EAST);
        } else if (292.5 <= rotation && rotation < 337.5) {
            player.sendMessage("SouthEast");
            dirblock = block.getRelative(BlockFace.SOUTH_EAST);
        } else if (337.5 <= rotation && rotation <= 360) {
            player.sendMessage("South");
            dirblock = block.getRelative(BlockFace.SOUTH);
        }
median wing
#

Okay, I'll try it and tell you how it goes

bronze horizon
#

k

bronze marten
#

bruh

bronze horizon
#

whats up

paper compass
#

How can I make an armorstand always be to the left of the eye location of the player

bronze marten
#

teleport

paper compass
#

bruh

bronze horizon
#

teleport it to the players location but slightly to the left?

paper compass
#

To the left of the player constantly, so the player can't look directly at it

bronze horizon
#

right

bronze marten
#

teleport in runnable

paper compass
#

no, left

#

lmfao

sturdy oar
#

damn that thing

bronze horizon
#

yes left but right as in correct

sturdy oar
#

if you were to use Kotlin it would look so nicer

paper compass
#
        new BukkitRunnable() {
            
            @Override
            public void run() {
                Player p = Bukkit.getPlayer("OHSRY");
                Vector direction = getVector(as).subtract(getVector(p)).normalize();
                double x = direction.getX();
                double y = direction.getY();
                double z = direction.getZ();
                Location changed = p.getEyeLocation().clone();
                
                changed.setYaw(180 - toDegree(Math.atan2(x,z)));
                changed.setPitch(90 - toDegree(Math.atan(y)));
                as.teleport(changed);
            }
        }.runTaskTimer(this, 3, 3);
    }```
#

I have that

#

Ignore the other code, thats to make it so it just always looks at the player

bronze marten
#

why not do repeated division by 45 starting from 22.5

#

and then map those values 1-8 to their blockface value

median wing
#

@bronze horizon Did you keep roation numbers the same?

#

what did you change?

bronze horizon
#

i changed the rotations around and changed the rotation variable math

#

does it work?

median wing
#

Yah

bronze horizon
#

cool

median wing
#

wait which line to, this? double rotation = Math.abs((player.getLocation().getYaw()) % 360);

bronze horizon
#

yep

median wing
#

So rotaion is the same

#

like the ifs

bronze horizon
#

also no

#

had to change that too

#

it was backwards

#

north was south etc

median wing
#

Ohh, thank you so much

#

I greatly appreciate it

trail dust
#

Anyone have any experience with WorldGuard API that can give me a hand?

silk gate
#

dont ask to ask, just ask

trail dust
#

Aight legit cannot get anything to work with the WorldGuard API, I'm literally just trying to query through the regions on the selected server to get information on the flags. More specifically the block-break and block-place flags as I want to validate that they are disabled/enabled

#

Already looking at the docs, explains some but I canny just implement it into my code :/

ashen stirrup
#

How would you get the index of a certain item in an inventory?

vale ibex
#

My server crash when a player try to join

analog crypt
#

@ashen stirrup Loop through each slot and check if it contains and item, and if it does, if it is an item of the type you're looking for.

ashen stirrup
#

Okay

analog crypt
#

Need an example?

ashen stirrup
#

Nah all good

analog crypt
#

Great

iron sleet
#

umm i need help

median wing
#

@bronze horizon Everything works fine in my code, but when I changed the directions to correct ones, my event for the smelting feature which essentially autos melts for you does not work anymore, any ideas on why?

iron sleet
#

how do i implement one of my worlds to sprigot like i have the file of my world but where do i put it

pure pasture
#

How can you cancel all tasks in one plugin but not in all plugins on the server?

uneven cradle
#

Is there a Spigot equivalent of Forge's PlayerTickEvent (i.e something that runs every tick that you can get a Player object from).

subtle blade
#

No. Though you can create a BukkitRunnable that runs once every tick and pass a Player

uneven cradle
#

Does it have to be a specific player or can I run it on all players?

subtle blade
#

You can run one task on all players if you'd like. It's up to you. As far as the runnable is concerned, it runs on the server at any interval you want

#
new BukkitRunnable() {

    @Override
    public void run() {
        // Do whatever you want here
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.sendMessage("Hello world!");
        }
    }

}.runTaskTimer(plugin, 0L, 1L); // 0 tick delay, run every tick```
uneven cradle
#

OK, thank you.

subtle blade
#

Or through the scheduler so you can use a lambda with the Runnable interface, but you don't have the ability to cancel from within the task

remote socket
subtle blade
#

Didn't exist

vale ibex
#

@frigid ember

#

i heave a TAB plugin

#

neznamy is the dev

subtle blade
#

1.12.0 it was added, Scribblz

vale ibex
#

i realy need help with that:/

#

if i try to remove papi plugin

#

working

#

;-;

#

wait

crimson sandal
#

Man I posted an update to Bukkit 2 days ago and it's still not been approved 😦 There must be a backlog or something?

vale ibex
#

other than that, no

#

if you try to connect..a vid world appears and after a few seconds..you get a crash

#

and then the error above appears

sage flame
#

What's the /restart command supposed to do btw, because afaik without any plugins it can only stop the server

subtle blade
#

Spigot allows you to define a restart script

vale ibex
#

or?

sage flame
#

Ohh, whenever I google it I only find plugins

#

I'll have to do some more digging ig

vale ibex
#

i dont use this

#

restart-on-crash: false

#

should i do it?

sage flame
#

I'm assuming the cmd.bat it just whatever bat file I use to launch the server

vale ibex
#

sh

gray plume
#

Is there a way to have it so NametagEdit only works in certain worlds?

ornate mountain
#

I might be stupid but I don’t know how to make players deal more damage... I’m making an RPG plugin and I’ve made items which you click to add a prefix to your name. How do I make it so somebody with a “[Wa]” prefix deals .75 times normal damage? And how do I make them take that much?

vale ibex
#

mhm...

#

yeah..but my problem..

#

i know..

#

i need help with this problem..

ornate mountain
#

I don’t know how to use the “entitydamageentity”

#

Event

shadow sigil
#

Guys i wanna get the entityType from config but i couldnt make it

#

Can anyone help me about it ?

subtle blade
#

Version?

shadow sigil
#

1.15.2

subtle blade
#

Registry.ENTITY_TYPE.get(namespacedkey)

#

NamespacedKey.minecraft("cow") for instance is equivalent to "minecraft:cow"

shadow sigil
#

soo i am a newbie java user can u explain a bit about that code

#

i sould like to know what am i doing not just copy paste the code

#

i would be glad if u can

subtle blade
#

Registry is a class in Bukkit that has a bunch of different registry constants (including one for EntityType, ENTITY_TYPE). You're accessing it statically and calling get() which accepts a NamespacedKey. This is a unique, namespaced identifier for entity types

bold hemlock
#

hi so is spigot a plugin or can you host a server on your own pc?

subtle blade
#

To get one with the Minecraft namespace (again I use minecraft:cow as an example), you would use NamespacedKey.minecraft("cow")

blissful verge
#

Why can I not give items w/custom model data with spigot

uneven cradle
#

@bold hemlock Spigot is a server software you can host on your PC

bold hemlock
#

ah ok

#

so where is the download please

uneven cradle
#

Is this the correct way to get an instance of your plugin?

private final JavaPlugin plugin = new HealBackport()
sturdy oar
#

you have to build it

#

@uneven cradle no

subtle blade
#

No. The classpath will prevent you from constructing an instance of your plugin's class

#

?bt @bold hemlock v

worldly heathBOT
bold hemlock
#

tnku

blissful verge
#

pls send help

sturdy oar
#

one of the common way is to pass your plugin as an argument, or use like getInstance();

blissful verge
#

Why can I not give items w/custom model data with spigot

subtle blade
#

You can

#

ItemMeta has #setCustomModelData(int)

uneven cradle
#

So how can I create a new instance of my plugin in that case?

subtle blade
#

You don't. You should pass it through your class' constructor

vale ibex
#

:/

shadow sigil
#

Can i ask one more thing when u are not bussy

subtle blade
#
public class MyListener implements Listener {

    private final YourPluginClass plugin;

    public MyListener(YourPluginClass plugin) {
        this.plugin = plugin;
    }

}```
blissful verge
#

Like what

#

What command do I run?

subtle blade
#

oh you're doing this from in-game, not code, Novato?

#

Should be the exact same as you would do in vanilla

#

/give @p diamond_sword{CustomModelData:1}

blissful verge
#

but it wont work

subtle blade
#

You're using Essentials

blissful verge
#

so?

#

How do I do it with that then?

subtle blade
#

It overrides a lot of vanilla commands (because lol, screw essentials)

#

Prefix your command with minecraft:

#

/minecraft:give @p diamond_sword{CustomModelData:1}

blissful verge
#

oh

#

thanks

shadow sigil
#

Okey can i ask one more question now ?

#

Registry.ENTITY_TYPE.get(NamespacedKey.minecraft(plugin.getConfig().getConfigurationSection("Bosslar").getConfigurationSection(args[0]).getString("Tür")));

#

So i am using this code to register an entity type from my config

#

How am i going to spawn it ?

blissful verge
#

Is there a simple way to disable using a custom item in a normal crafting recipe?

subtle blade
#

World has a spawnEntity() method or something that accepts an EntityType

shadow sigil
#

Yes but i mean like in String a =... i am using a to get that string

#

What am i going to use to get that registered entity type

#

Sorry if i am bothering you i am newbie :/

subtle blade
#

You have it! get() will return an EntityType for you 🙂

#

Just assign that line to a variable

shadow sigil
#

Oh

#

Now i get it thx

blissful verge
#

Is there a way to make an item only be used in a single craft?

#

Like make it have some custom tag thingie

#

Is there smthing like that in mc

boreal tiger
#

shouldnt MemorySection#get("something", "default") be annotated with NotNull instead of nullable

ornate mountain
#

Does anybody know how to use “entitydamagedbyentity”? I’m trying to make it so if a player has a prefix they deal more damage..

frigid ember
#

hello guys!

#

how can i grow a community with a small budget?

subtle blade
#

But it is nullable, Att

#

If the section doesn’t exist it’s going to return null

boreal tiger
#

wouldnt it return the default val?

subtle blade
#

Default value can be null

boreal tiger
#

ah yeah, it would look weird asf but yeah. thank you 👍

sacred wave
#

Is there some function similar to World#getHighestBlockAt, but not for the highest block, but for lowest possible spawnable location above specified location? Or I need to implement this myself?

subtle blade
#

Might have something in the height maps

#

Not 100% familiar with the height map API because it was recently added

sacred wave
#

Well default spawning behaviour woks this way? or does it use getHighestBlockAt?

#

Resp, when on Respawn I set Player location it has slightly "smarter" behaviour than just porting player to a Location

subtle blade
#

Don’t know the specifics

sacred wave
#

Ok, thanks anyway 🙂

vapid kindle
#

so... does anyone here have an in-depth knowledge in the design of the entity activation range in Spigot? Because I've been wondering why the range only applies in the X/Z direction but not Y.

hoary parcel
#

Ask aikar

vapid kindle
#

thanks

sharp trout
#

Does anyone know if NBT data is preserved even after placing a block? I assign an NBT tag to an item, but:

        NBTTagCompound nbt = event.block.getState().getSnapshotNBT()```
Contains the block's name, but not the NBT tag I assigned.
subtle blade
#

What API are you using. What?

sharp trout
#

That's NMS

subtle blade
#

event?

sharp trout
#

BlockPlaceEvent

rigid nacelle
#

Wait... Does blocks have nbt tags? I mean, a part from tile entities...

subtle blade
#

But a public field? Anyways... no

#

Blocks don't hold NBT

rigid nacelle
#

I'm aware of blocks being metadatable but..
Yeah, thought so.

sharp trout
#

TileEntity then?

subtle blade
#

If it's a tile entity, any NBT on the item not wrapped in BlockEntityTag will not be held

sharp trout
#

Hmm

subtle blade
#

In fact, it's discarded when read / saved afaik

#

The tile entities only care about what it needs

sharp trout
#

I might be better off saving the block's location instead of using NBT tags then

subtle blade
#

Yes, definitely

sharp trout
#

Thanks

subtle blade
#

If you look at any tile entity implementation, you'll see why this won't work

sage flame
#

Using online tutorials is probably the easiest way to learn

#

For world guard

bronze horizon
#

@median wing sorry for the late reply can you send your entire code in a dm pls

#

so i can have a look at all the events

unkempt atlas
#

Hello, I bought a plugin and it's not letting me download the plugin.

subtle blade
#

Give up to 24 hours. PayPal has reportedly been having processing issues as of late. If still not received after that time, contact the author with proof of purchase

unkempt atlas
#

Okay, Thanks.

radiant pollen
#

@frigid ember You can't run a server if you can't figure out how to use WorldGuard.

#

No one is going to get on your server and do it for you, but you can ask us specific questions.

lofty elbow
#

how long do resources take to get verified

storm tulip
#

like a month

lofty elbow
#

crazy

boreal tiger
#

well they are not charging you a fee on what you sell

#

so this seems fair

sharp trout
#

POI data mismatch: never registered at BlockPosition{x=-51, y=69, z=-142}
Does anyone know what causes this?
It happens when I cancel a place event for a Blast Furnace, the same thing doesn't happen for a diamond blocks but I'm not sure about other blocks.

vapid kindle
#

it happens when you cancel the placement of Villager job blocks

sharp trout
#

Is it a bug?

vapid kindle
#

I don't know, I've ignored it so far and haven't noticed any issues

sharp trout
#

Just a bit annoying with the console spam

subtle blade
#

Latest version? afaik that hasn't been an issue for some time now

sharp trout
#

I'll build the latest version and see

#

The jar I use for testing is a few months old

subtle blade
#

It may be as a result of the new villager points of interest. In such a case, a bug report on the JIRA would be nice

#

(Spigot's, not Mojang's)

sharp trout
#

👍

subtle blade
#

Just make sure you can replicate it on the latest version 🙂

sharp trout
#

Will do

subtle blade
#

?jira for reference. Thanks!

worldly heathBOT
subtle blade
#

I might take a stab at fixing it once a report gets made

#

Though md will likely beat me to it because I work in a few hours

naive goblet
#

Can’t you?

sturdy oar
#

😂

naive goblet
#

That dude deleted the message so it looks like I replied to Choco :/

sharp trout
#

@subtle blade Same error in the latest build

#

I'll make a report

hoary parcel
#

imagine screenshotting timings

#

and not sharing the link

boreal tiger
#

😂

hoary parcel
#

dont pm me, just post them

#

holy shit spartan is going full retard on your server

#

same with the framed maps from bkcommonlib

#

sssuuure

#

lmao

#

I mean, more ram for your server would hurt

#

3.6g is reaallly low

random lark
#

can someone help me figuring out why my placeholders aren't working with holographic displays?

hoary parcel
#

well, do they run 1.15?

subtle blade
#

You're on a fork anyways. Why exactly are you asking questions regarding performance here?

hoary parcel
#

how can you have mods on a bukkit server 🤔

boreal tiger
#

you said paper

hoary parcel
#

you said paper

#

but as I said, ram and gc isnt your number one issue

#

its your stupid anti cheat

#

and most likely excessive use of framed maps

#

well, or work with the author to figure out whats wrong

#

you paid for that, didnt you?

#

np bby

#

but like, you run an offline server anyways, sooooooo

#

nobody really cares

#

if said plugin uses 80% of lag ticks using a single scheduler I blame it, yes

#

I named 3 things to look at, he should look at all those things

sturdy oar
#

I mean google and read

#

you probably added the wrong permission in the config.yml

#

or didn't gave the users the proper group

#

i mean

tender moss
#

Hey @subtle blade, I was wondering if you could accept my friend request, just need some help 🙂 Preferably in private.

sturdy oar
#

i don't think he does help in private

tender moss
#

It's quite complex, and I'd prefer not to get accused of calling another member out.

sturdy oar
#

🤷‍♂️ ok

median hill
#

have a huge problem with lagg on my server, not related by entities or chunks, the server doesnt take all the gb it needs, it have 7gb and only takes 4. We are using paper

subtle blade
#

DMs are open. Don't need to FR me

cursive osprey
#

Is chunk#getBlock any faster than world#getBlock?

#

ie: would getting the chunk and getting lots of blocks from that, be faster than getting lots of blocks within one chunk directly from a world.

median hill
#

have a huge problem with lagg on my server, not related by entities or chunks, the server doesnt take all the gb it needs, it have 7gb and only takes 4. We are using paper

sturdy oar
#

Bobby_Harron

#

do you have matching heap flags for the JVM?

#

what message do you get when you execute /server

#

on default group

radiant pollen
#

@median hill Are your JVM flags correct?

frigid ember
#

@frigid ember what permissions manager are you using on your server? And which version is your server? (Spigot not bungee)

versed forge
#

how can i get the 1.7 API for spigot and bukkit ??

#

as its no longer on maven ?'

subtle blade
#

DMCA'd

#

Doesn't exist

frigid ember
#

where i can find test builds for 1.16?

subtle blade
#

Not released

#

Doesn't exist

#

lol

versed forge
#

thanks choco

frigid ember
#

@frigid ember are all servers using luckperms?

obtuse rose
#

Why do my plugin Material broke
I've compiled with spigot 1.15.2, set api-version to "1.15" and run the server on spigot 1.15

#

But it seems like material comparison (In switch-case ) return false when it's suppose to be true

subtle blade
#

Let's see the plugin.yml and the switch (& relevant code)

gleaming totem
#

Have you tried running some System.out.println to make sure you’re comparing the correct things?

obtuse rose
#

In some case it does work, some case doesn't work
(Some material comparison failed)
I've had this problem before when I didn't specify API version but I did this time so I am quite confused

subtle blade
#

Let's see the plugin.yml and the switch (& relevant code)

obtuse rose
#

Like it's working fine when compare grass, but not for coral

@subtle blade jeez calm I'm opening it xD

subtle blade
#

Let's see the plugin.yml and the switch (& relevant code)

#

lol

#

FASTER FASTER FASTER

obtuse rose
subtle blade
#

1.15.2 doesn't exist for api-version

#

It's just 1.15

obtuse rose
#

Oof someone please slap me 😅

subtle blade
obtuse rose
#

Well that was embarrassing xD

alpine musk
#

You're saying 4 GB of RAM isn't enough. I know 100 plugins, 2.5 GB of RAM and everything's fine.

subtle blade
#

And some programs are more memory-hungry than others

#

You can't look at one environment and apply it to every single other one

limber moth
#

Hi all does anyone know if the spigot api is cached? If so for how long?

subtle blade
#

I can't remember if it's 6 hours or 4

#

I'm leaning towards 6

#

Also, that's legacy API. Recommend switching to simple

limber moth
#

is there examples there?

subtle blade
#

Yep

limber moth
#

ill check it out, thank you

subtle blade
#

(That one is cached as well - in case that wasn't clear)

#

I'm fairly certain it's 6

limber moth
#

I assumed that too, thanks

#

if you post an update does that force an update?

subtle blade
#

I don't think so, no. Though update checks shouldn't be to the minute accurate either. Just wasteful API checking

#

Can understand the desire for at least a webhook though. That might be an option if you create an issue on that repository I linked above

limber moth
#

ah ok, it must have been a coincidence then when I updated the version on spigot I saw it almost immediately after

subtle blade
#

With webhooks you could at least listen on that in a Discord bot or whatever

rotund fulcrum
#

Minecraft server, even when online, refuses to connect.

#

Idk what it is

#

Help

#

Also, if you recommend a free domain service please tell me

#

Ping me to get my attention

pure pasture
#

Can you get if the inventory you clicked in is a chest?

bronze marten
#

Store player from PlayerInteractEvent

bronze marten
#

oh

obtuse rose
#

@subtle blade is api-version a string?

limber moth
#

like in the plugin.yml?

#

I just have it like api-version: 1.13

#

@obtuse rose

obtuse rose
#

yea but is it a string?

#

when get parse

limber moth
#

no idea

sturdy oar
#

it's a string

hoary parcel
#

yes its a string

sturdy oar
#

so you could write it as "1.13"

#

or '1.13'

limber moth
#

yep

#

should allow that

hoary parcel
#

yaml falls back to strings

limber moth
#

ahh

storm tulip
#

so I dont get why I would put 1.15

#

or 1.13

rotund fulcrum
#

Minecraft server, even when online, refuses to connect.

#

pls halp

hoary parcel
#

to disable the legacy material combat layer

#

and to be able to actually use new materials, lol

storm tulip
#

hmm ok

final verge
#

Basically says your plugin won’t work with any version lower than that

storm tulip
#

I put 1.13 but mine all work 1.8-1.15.2 ( I use a Material layer )

limber moth
#

same

sturdy oar
#

i mean '1.15' does not have any sense as the moment, unless you don't want people <1.15 to use your plugin

rotund fulcrum
#

ping me if u know something about my problem

hoary parcel
#

imagine supporting 1.8

sturdy oar
#

MinDigger

#

this is the wrong discord to make that joke

#

😂

hoary parcel
#

no

#

I can make that everywhere

#

but I guess ppl over on that fork that shall not be named are more sane in that regard, ye

#

75% 1.15 🦾

sturdy oar
#

bStats eh

hoary parcel
#

ye

#

its actually 77% already

#

wooo

sturdy oar
#

why is the global stats bugged

#

or different

hoary parcel
#

only 2.3% on 1.13 😄

#

wdym?

sturdy oar
tiny dagger
#

but from that 55.7 % it's 100% 1.15.2 :d

hoary parcel
#

thats global

sage flame
#

I mean why would they use a previous release of it

hoary parcel
#

I was speaking about stats about the fork that shall not be named

sturdy oar
#

oh we were talking about that other fork

hoary parcel
#

which has 77% on 11.5

subtle blade
#

11.5

hoary parcel
#

ye

#

sorry choco we a bit ahead 🚀

subtle blade
#

That's behind!

sturdy oar
#

🧠

marble narwhal
#

Why are we not allowed to say the fork it's name?

sage flame
#

Can't believe spigot is 14 versions behind

subtle blade
#

so I dont get why I would put 1.15
or 1.13
Also prevents loading on previous versions (as of 1.13 when it was added, obviously)

#

Some of my plugins specify 1.15 because API was added in those versions that I rely on

sturdy oar
#

is it only me who uses Paint 3D to visualize stuff

#

like i can't think if i don't see stuff in 3D

#

when working with solids

hoary parcel
#

idk about your semver choco, but 1.15 is behind 11.5 😄

#

"Why are we not allowed to say the fork it's name?"
well, saying paper isnt banned

#

but discussion of forks here doesnt make much sense

#

and I just like joking around, I think its a funny term 😄

subtle blade
#

Ohhh ic ic

#

I math gudly, I promise

tiny dagger
#

'The forbidden build' :p

marble narwhal
silver pewter
#

Is there a way to send one message every 3 seconds on playerMovementEvent thanks

fiery kernel
marble narwhal
#

@silver pewter If you're looking for a pre made plugin, not sure. If you're a programmer, you can store the time when you send a message. Every time you want to send a message check if that time + 3 seconds is greater than the current time. If so you can send a new message, and otherwise you cancel the message 🙂

frigid ember
#

** anyone know if there is a flag for world guard so that tools don't lose durability ? **

silver pewter
#

@marble narwhal I've done that but it sends x amount of messages on where I walk

marble narwhal
#

Do you have some code to show?

silver pewter
#

Yeah

marble narwhal
#

I'm not sure if there is one Dangerous D:

silver pewter
#

@marble narwhal look in dms

marble narwhal
#

@frigid ember I see this mentioned on the plugin page. Are you sure these things aren't the case?

Make sure you do not have permissions for the following permission node:

worldguard.region.bypass.<world>.<region>.<flag>

Also make sure you have use-player-move-event set to true in WorldGuard config.

Please also note that if you are OP you have all the permissions, meaning that you are bypassing every flag the plugin provides. This can look like the plugin is not working.```
sturdy oar
#

Choco

#

about that thing you told me earlier about particles

#

so each particle get sent as an individual packet

#

?

boreal pebble
#

To update my server, do I get the new jar and just swap it out

dense ridge
#

anyone got any idea how to set the blockplacespeed of an editsession/operation with asyncworldedit?

wicked atlas
#

How do you use Messenger to send a message? I only see things to deal with channels, but I don't know where else to look

marble narwhal
#

@frigid ember Then try it without OP 🙂

wicked atlas
#

also that's for sending packets to the client, right?

marble narwhal
#

Then I'm not sure Dangerous.

#

Because the page description says so. Did you read what I send you? OP might cause issues with some flags.

#

@wicked atlas What is it you're trying to do?

wicked atlas
#

I'm trying to send a custom packet to the client

#

On a custom channel

marble narwhal
#

By using a permission plugin.

#

And let me check realy quick redstoneguy 🙂

#

I've never used pex, I'm sorry. Try looking at some kind of wiki or anything similar.

keen compass
#

PEX has documentation pages, and yes you can do it from the console

wicked atlas
#

Does anyone know how I would go about sending a custom packet to the client? I can't find any way to actually send a message in the channels created with Messenger

marble narwhal
frigid ember
#

@frigid ember what MC version you using?

#

PEX on 1.15?

#

really?

#

uhm

#

It's probably as broken as GM on 1.15

marble narwhal
#

I think they were referring to Group Manager.

wicked atlas
#

Thank you so much, Thom

marble narwhal
#

Np ^^

frigid ember
#

Yeah GM as in Group Manager

#

not gamemode

#

as far as I'm aware there's no complete official 1.15 pex or am I mistaken?

marble narwhal
#

I don't have WG, I'm also not going to mess with it because it's getting late for me.

tiny dagger
#

How should i go about caching skins? 🤔

marble narwhal
#

Can you be a bit more specific, Fr33styler. What is it you're trying to do?

keen compass
#

cache the game profile

#

I mean the server does it anyways and I think you can increase the cache size

bitter tendon
#

What is the difference between Bukkit and CraftBukkit?

keen compass
#

bukkit is the api

#

craftbukkit is the server implementation that implements the bukkit api

frigid ember
marble narwhal
#

Are you messing around with packets?

bitter tendon
#

Can I import stuff from CraftBukkit in my plugin? @keen compass

toxic heron
#

oh no JSON files shudders

frigid ember
#

@marble narwhal no im not dumb

#

and people are sometimes invisible when they join

marble narwhal
#

You're not dumb for messing around with packets lol, how else would plugins like ViaVersion be made.

frigid ember
#

its via version?

toxic heron
#

I think that was just an example

marble narwhal
#

That is not what I was trying to say, but it could be a ViaVersion problem if you've that plugin running yes.

#

Try updating your plugins that mess around with the protocol, so ViaVersion, ViaBackwards, ProtocolSupport, ProtocolLib. Whatever you've running. And if that doesn't work try to figure out which plugin is messing up your client.

#

And report the issue to the creator of that plugin.

wicked atlas
#

Is there no event to detect when a player's saturation/exhaustion changes? I found FoodLevelChangeEvent, but can't find anything for the others. I'm hoping I'm just bad at searching

frigid ember
#

people are timing out now

marble narwhal
wicked atlas
#

of course

#

is it a bad idea just to check every tick?

marble narwhal
#

Performance wise, yes.

subtle blade
#

That’s a weird one to implement because adding 2 new events for very similar concepts is gross

frigid ember
#

Only thing you could do is check on damage or on food level drop

subtle blade
#

Though if we were to add it into the existing event, say with constants as reasons, it would break compat with old plugins

#

Because they would be expecting only food changes

wicked atlas
#

I'm reimplementing the server part of appleskin on spigot, so I really need to know when exhastion/saturation changes

marble narwhal
#

I would much prefer such an event not getting renamed xd

subtle blade
#

Wouldn’t be renamed but have constants added to not break binary compat, just logical compat

wicked atlas
#

Can't you just deprecate the food event and make a new one, like HungerChangeEvent or something?

marble narwhal
#

Wouldn’t be renamed but have constants added to not break binary compat, just logical compat
But then the name of the event would not really match what is actually happening. It's not just food changing.

subtle blade
#

That would be the likely approach, yes

#

Are saturation and exhaustion exposed already through the API? In the Player interface?

#

(On my phone, can’t check)

frigid ember
#

Yeah

#

Player.getSaturation();

wicked atlas
#

yep

late tangle
#

Using the Citizens-API. How would I cancel equipment of armor right clicking on a NPC, whilst holding armor? I'm currently using the NPCRightClickEvent.

subtle blade
#

Exhaustion too?

wicked atlas
#

yes

marble narwhal
#

Woops

#

xD

wicked atlas
#

so is repeatedly checking it my best bet for now?

subtle blade
#

Yea there should be an event. I’ll see about adding it tomorrow

#

I’ll likely take the deprecate and new event approach

radiant pollen
#

What do you mean deprecate?

subtle blade
#

The hunger change event

#

can have that part of the new event

radiant pollen
#

Oh okay

marble narwhal
#

Are you a spigot contributor?

subtle blade
#

Yes

radiant pollen
#

Makes more sense than what I thought you were talking about.

wicked atlas
#

how often does spigot release? should I just wait for a new spigot release?

subtle blade
#

Pretty much daily

#

Every commit is a release

wicked atlas
#

oh wow

radiant pollen
#

BuildTools isn't always updated though.

subtle blade
#

It is

#

Oh you mean BT itself, yea

#

Though it’ll build the most recent Spigot by default

#

I’ll have to write that event down so I don’t forget lol. About to start my shift

marble narwhal
#

Good luck ^^

keen compass
#

@radiant pollen what needs to be updated with buildtools?

radiant pollen
#

I was just saying that just because you run the latest BuildTools and get the latest version on there doesn't mean it's the newest release of Spigot.

vale slate
#

^

red bolt
#

anyone got any good tutorial on abstraction ?

#

preferably, something that covers every scenario

radiant pollen
#

You can't cover every scenario with a tutorial.

marble narwhal
#

That does bring up the question, how do people usually deal with API changes which are not NMS? I had been thinking about it today but couldn’t really come up with a good solution..

late tangle
#

@marble narwhal Didn't work unfortunately. For now I've just set it to left-click on that NPC. But still want it to work with the armor part however. :/

vale slate
#

That does bring up the question, how do people usually deal with API changes other then NMS? I had been thinking about it today but couldn’t really come up with a good solution..
@marble narwhal I would not add a new layer of abstraction, I just would release an update

marble narwhal
#

Dropping older versions you mean?

vale slate
#

well, no, I just would create a version 2.x for the new api version

red bolt
#

probably reflection

vale slate
#

Reflection should be your last card to play

#

It's considered hacky

marble narwhal
#

I probably explained it wrong, imagine Spigot renaming a class, or adding a new method in version X, which previously had to be done with NMS. And you want to update so you don’t have to use NMS for new Spigot versions. How would you properly abstract such things

vale slate
#

oh god, I totally misunderstood you

marble narwhal
#

My bad, don’t worry 😅

vale slate
#

uhm, I would go to my NMSManager class I have in every plugin of mine using NMS and replace my NMS abstraction with the API one

#

and deprecate it

#

and in some release, when I managed to refactor everything using this feature, I'd remove my NMS abstraction completely

steady osprey
#

i cant figure out how to hook papi into my plugin

vale slate
#

???

#

PlaceholderAPI?

steady osprey
#

yeah

sturdy oar
#

Read the github documentation

#

It's pretty clear

steady osprey
#

the method is deprecated and the other one doesnt make sense to me

sturdy oar
#

Which method

marble narwhal
#

@vale slate Thanks, you gave me an idea on how I could approach what I want. I’m going to sleep btw, good night all ^^

bitter tendon
#

MinecraftServer.getServer() is deprectated, but it is not indicated what is the newer alternative. Someone knows the new function?

pure pasture
#

Can somebody explain why I can still use the command on myself? if(target == cms.getName())

sturdy oar
#

Ehm

#

Strings

#

is getName a string

vale slate
#

and the next one

steady osprey
#

new Placeholders(this).hook();

pure pasture
#

I also tried it with the players doesnt work either

sturdy oar
#

Can you answer

#

is getName() a string

vale slate
#

MinecraftServer.getServer() is deprectated, but it is not indicated what is the newer alternative. Someone knows the new function?
@bitter tendon Why are you working with the NMS McServer

pure pasture
#

Yes it it

sturdy oar
#

Bro

pure pasture
#

it is*

sturdy oar
#

You don't compare strings with ==

#

That is the most wrong thing ever

pure pasture
#

You don't?

steady osprey
#

you use .equals()

pure pasture
#

OUCH

vale slate
#

^

steady osprey
#

or equalsIgnoreCase

vale slate
#

Explanation required

#

?

sturdy oar
#

There are some odd situations where == is fine , but certainly not yours

bitter tendon
#

I'm doing a comand manager, and I need to get the CommandListenerWrapper and access other nms stuff as well. But MinecraftServer.getServer() is deprectaed, so I was wondering if anyone knew the new function

#

@vale slate

pure pasture
#

Doesn't work with .equals and .equalsignorecase either

sturdy oar
#

What is target

#

In your code

pure pasture
#

I changed it player.getName()

#

And player is the target of the command

vale slate
#

I'm doing a comand manager, and I need to get the CommandListenerWrapper and access other nms stuff as well. But MinecraftServer.getServer() is deprectaed, so I was wondering if anyone knew the new function
@bitter tendon ((CraftServer) Bukkit.getServer()).getHandle().getServer()

pure pasture
#

Player player = Bukkit.getPlayer(target)

#

String target = args[0].toString;

#

That is target

bitter tendon
#

Awesome thank you @vale slate 😄

vale slate
#

nP

#

or if you are inside a custom NMS entity you should use getServer()

steady osprey
#

is this the right way to register placeholders

if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new Placeholders().register();
        }
pure pasture
#

@sturdy oar you gone?

dusty topaz
steady osprey
#

i did that it doesnt work

frigid ember
#

@pure pasture should definitely research ==, equals, and hashCode in java(And probably any language you do because it wont work the same way in every language)
== does a pointer comparison when dealing with objects(can use it fine on primitive data types). In most cases doing == with strings wont work unless the JVM recognizes them as 'final and never changing' and optimizes it on compile which in your case will never happen.

I've had to deal with a few optimized variables in the past and its always fun trying to do some hacky code to edit them after runtime.

You'll have to give more code though for anyone to help understand why if(target.equalsIgnoreCase(cms.getName()) fails. An easy way for you to help debug it is print/log both target and cms.getName()

frigid ember
#

looks like you do need to do isApplicable to prevent UnsupportedOperationException from happening if the modifiers map does not have the armor enum value as a key in the map.

This is all deprecated but hopefully a new method pops up to do the same whenever its actually removed.. And also hopefully this even still works at all

granite cedar
#

i got the digital dash

bitter tendon
#

How to convert net.minecraft.server.v1_15_R1.Entity to org.bukkit.entity.Entity? (Also for EntityPlayer to Player)

frigid ember
#

don't you do getHandle to get CraftEntity and then that can cast to bukkit entity

granite cedar
#

then hover where you get the entity and import the org.bukkit version

frigid ember
#

or also do that if you're importing wrong

granite cedar
#

you remind me of a quaterback

frigid ember
#

hopefully you understand the possibility of importing wrong class tho if you putting spigot as depend instead of the api

bitter tendon
#

I'm using the right imports, I just need to go from vanilla class reference to bukkit class reference

frigid ember
#

then do what I said

#

if I remember the API correctly that should work

bitter tendon
#

For an arrow, this is how it goes from bukkit to vanilla:
net.minecraft.server.v1_15_R1.Entity arrow = ((CraftArrow) entity).getHandle();
But I do not know the other way around

dusty topaz
#

@bitter tendon ignore them

#

CraftEntity.getEntity(server, entity);

#

will get you back to craft entity

#

which you can cast to your bukkit entity

frigid ember
#

oh pog

#

why does that need server arg 🤔 i go check

dusty topaz
#

because craft entity takes a server in constructor

nova mural
#

oh

#

poggers

frigid ember
#

oh.. it makes an entirely new object..

dusty topaz
#

yep

bitter tendon
#

Thanks @dusty topaz what should I put in as the server parameter?

dusty topaz
#

cast Bukkit.getServer() to craftserver

#

should work

nova mural
#

is there any difference at all between org.Bukkits ChatColor and net.md_5’s

#

i never realized i mixed the two

dusty topaz
#

one is bungee one is bukkit

nova mural
#

hm

#

and idk why i didn’t realize that

#

thanku

bitter tendon
#

Alright, thanks 😄

dusty topaz
#

Can I ask how you ended up in that position

#

where you have an nms entity and need to get a bukkit entity

bitter tendon
#

I'm making a command manager and messing with brigadier to do so

#

Is there also a function to convert a List of entities all at once?

lament coral
#

Could someone help me with the following error when connecting to server? Could not connect to default or fallback server. I have been messing with config files for awhile. Help?!

dusty topaz
#

@bitter tendon you could just use a stream

#

and convert them all

bitter tendon
#

How can I use a stream?

dusty topaz
#

something like

#

list1.forEach(x -> list2.add(CraftEntity.getEntity((CraftServer) Bukkit.getServer(), x)));

bitter tendon
#

ooo, nice thanks again

frigid ember
#

using getBukkitEntity is definitely better because its cached on the Entity instead of new object each time

dusty topaz
#

unaware of such a method

#

but if its cached then yea

#

yep they're right, use Entity#getBukkitEntity instead

vital delta
#
List<CraftEntity> entities = list.stream()
.map(x -> CraftEntity.getEntity((CraftServer) Bukkit.getServer(), x)))
.collect(Collectors.toList());
dusty topaz
#

almost good oscar but you need to use getBukkitEntity

#

always a step behind

vital delta
#

shHHhh

#

use stream api properly

#

dont just call foreach and add to another list 😠

dusty topaz
#

😦

#
List<org.bukkit.entity.Entity> list = list1.stream().map(Entity::getBukkitEntity).collect(Collectors.toList());
#

there

#

😎

bitter tendon
#

Wait, how is there a bukkit function getBukkitEntity() in a vanilla class? o_O

#

Those are nice oscazz & AcroVulcan 😄

dusty topaz
#

@vital delta isn't nice 😠

bitter tendon
#

I was refering to the code anyway xd

vital delta
#

qq

bitter tendon
#

The type Entity does not define getBukkitEntity(EntityPlayer) that is applicable here

dusty topaz
#

is that a console error?

#

or in your IDE

bitter tendon
#

IDE

#

error

dusty topaz
#

You've got a list of entity players

#

getBukkitEntity is returning entities

#

would need to cast separately in that case

#

show the code?

bitter tendon
#

Same for getBukkitEntity on a EntityPlayer?

#
List<org.bukkit.entity.Entity> list = list1.stream().map(Entity::getBukkitEntity).collect(Collectors.toList());
#

With entities it also does not work:

#

Same error

#

Was using the wrong entity, this works:

#

Is there another way to then writing the entire namespace where there are two confliciting class names?

dusty topaz
#

why are you making a new list and then sreaming it

#

the new list you're making is empty

#

so streaming makes no iterations

bitter tendon
#

Yeah, it was just to test if it worked

ivory fiber
#

How can i update a score in the scoreboard with out p.setScoreboard?

gusty girder
#

within the "commands.yml" how would i go about disabling /mv version? normal players can use that command, dont know how or why if they dont have perms for it....

#

i tried but you can still access command?
` mv version:

  • []`
cloud crater
#

What permissions system are you using?

#

Guessing mv=multiverse, if your using luckperms set multiverse.core.version to false for defaults or if it’s something like permissionsex set ‘- -multiverse.core.version’ to default group

#

Or get a blocked-commands plugins that you can set new permissions to the command that are in a list. There’s a lot around, if you know java it’s quite simple.

frigid ember
#

anyone, is there a 1.15.1 protocal support

dusty topaz
#

via version?

frigid ember
#

no protocal support

#

spigot

#

not bungeecord

dusty topaz
#

??

#

you can stick viaversion on a 1.8 server

#

and join on 1.15

frigid ember
#

-_-

dusty topaz
#

if you dont explain the question

frigid ember
dusty topaz
#

your question is 6 words long

frigid ember
dusty topaz
#

is the latest download 1.15

#

no

#

so is there a version

#

no

frigid ember
#

fuck

#

i guess i will have to rebuild a server again

toxic moat
#

In theory wouldn't the 1.15.2 version work there? @frigid ember

frigid ember
#

@toxic moat l a z y

toxic moat
#

What do you mean? You asked if there was a 1.15.1 version of ProtocolSupport. They have a 1.15.2 version available. Wouldn't that work?

frigid ember
#

yo anyone know title manager? i changed some stuff and am now getting errors

radiant pollen
#

What did you change?

#

And what errors?

frigid ember
#

the side panel thing

radiant pollen
#

You have to be specific.

#

?paste

worldly heathBOT
frigid ember
#

just a internal error occurred when preforming this command

radiant pollen
#

Paste your config and the stack trace.

frigid ember
#

thats the section i was editing

#

think i found it

#

got it working

#

i was using grammer in the text so it messed up xD

radiant pollen
#

It's probably not that.

frigid ember
#

no it works now

radiant pollen
#

It's probably because one of the lines was more than 40 characters long.

frigid ember
#

whats the thing for ping isn't it %ping%

radiant pollen
#

%{ping} I think

frigid ember
#

yep thx

radiant pollen
#

No problem

frigid ember
#

hey by any chance you know the ones for Irdium Skyblock i can't find them online anywhere

radiant pollen
#

You mean placeholders for Iridium Skyblock?

frigid ember
#

yes

radiant pollen
#

Yeah, one sec.

#

It's on the GitHub.

frigid ember
#

thx again!

radiant pollen
#

:D

#

No problem

#

Make sure you always check a plugin's Github page. There's usually a wiki.

frigid ember
#

know the one for player exp cause the one on iridium didn't work and %player_exp% didn't work

golden chasm
#

It's my first time doing any server hosting

radiant pollen
#

30.04 02:48:48 [Server] Spigot Watchdog Thread/ERROR me.qKing12.AuctionMaster.meniu.MeniuEvents2.onPlayerJoin(MeniuEvents2.java:77)

#

It's your auction plugin @golden chasm

golden chasm
#

Thank you so much <333333

radiant pollen
#

No problem

#

@frigid ember If you're trying to use placeholders from PlaceholderAPI in Title Manager, try using the same format Title Manager uses.

frigid ember
#

Hello,

I'm having some issues with the entity.isOnGround() method. For some reason, when a ravager is set perfectly on the ground, entity.isOnGround() reads as false. I know for a fact that it is on the ground because I can directly see that it is on the ground. The only time that it correctly polls as true is generally the immediate moment that it touches the ground. I have absolutely no idea how to fix it. Any help would be appreciated.

Here is the full class: https://hastebin.com/eyexavulol.cpp

Note lines 47 and 62.

radiant pollen
#

So, try %{player_exp}

#

If the PlaceholderAPI format didn't work.

frigid ember
#

yeah still got nothing on that

radiant pollen
#

@frigid ember Are you doing something funky with the Ravager? If you're cancelling move events or something that might mess with it. Taken from the docs: This value is a state updated by the server and is not recalculated unless the entity moves.

frigid ember
#

Not cancelling any move events I don't believe.. Of course, I do have a player mounted on top, no idea if that would interfere

#

I am cancelling the ravager's target ai

radiant pollen
#

AFAIK, the isOnGround() method isn't always the best.

#

There might be a better way to check if an entity is on the ground.

#

IIRC, the height of every block is a multiple of 1/16. You could simply check if the remainder of the entity's height divided by (1/16) is 0. @frigid ember

#

You'd probably get some false positives, but there's probably some other checks you could do along with that.

keen compass
#

just get the block below the player

#

if they are flying it will be air

radiant pollen
#

That's slower and not always true.

#

There's a massive list of blocks that could be directly under you while you're flying.

#

You'd still technically be "on" that block.

frigid ember
#

So what you're saying is, get the entity's height, divide it by 16, and it should equal zero if it is on the ground?

radiant pollen
#

The remainder should equal 0.

keen compass
#

depends which method you use

#

if you use the method to get the block at the players feet

#

if they are flying it will be air

radiant pollen
#

Not always.

#

You could be in the "air" and the block at the players feet could be grass, carpet, a fence, etc.

keen compass
#

I don't see that being possible

#

since it is the server that checks that and not what the client sent

frigid ember
#
    public static void isOnGround(Entity entity) {
        Double entityHeight = entity.getHeight();
        Double entityRemainder = entityHeight % 16;
        
        if(entityRemainder == 0) {
            return true;
        } else {
            return false;
        }
    }
#

Something like this?

radiant pollen
#

entityHeight should not be an int. Otherwise it will always be on the ground.

#

You need the decimal values for height.

frigid ember
#

Ah so those should both be doubles then?

keen compass
#

need it to be either a double or a float

frigid ember
#

How about that ^

radiant pollen
#

Also, it's not % 16 it's % (1/16)

frigid ember
#

Ah, thanks

#

Lemme give that a shot 🙂

golden chasm
#

Are spawn limits per person? I'm having like an insane amount of mobs spawning

frigid ember
#

@radiant pollen, I appreciate your help.

The remainder is outputting as not a number (NaN) while debugging.

    public static boolean isOnGround(Entity entity) {
        double entityHeight = entity.getHeight();
        double entityRemainder = entityHeight % (1/16);
        Bukkit.broadcastMessage("Height" + String.valueOf(entityHeight));
        Bukkit.broadcastMessage("Remainder" + String.valueOf(entityRemainder));

        if(entityRemainder == 0) {
            return true;
        } else {
            return false;
        }
    }
#

I suppose it would have something to do with the unusual height.

radiant pollen
#

Oh wait

#

You're using entity.getHeight()

#

That's the actual height of the entity. You need to do entity.getLocation().getY();

frigid ember
#

Ah, I see. Will this still work for ravagers on slabs/unusual height blocks? I assume so because they increase by 1/16?

radiant pollen
#

Yes it should still work.

frigid ember
#

Okay. So another problem I'm seeing with this is that if I were to press space in the air, while at a Y value that is divisible by 1/16, it will still return true even though it isn't on the ground

radiant pollen
#

Yeah, that's what I mentioned before about false positive.

#

You could also check if entity.getVelocity().getY() == 0.

#

If they're going up or falling down from jumping, their velocity in the y direction won't be 0.

frigid ember
#

Ah! So then it would only return true if there was no prior Y velocity, that would make sense

radiant pollen
#

Yup. Then the only false positive you would get is if the apex of the jump was a multiple of (1/16).

#

And even then, that might not be true because I think as soon as you reach the max height of the jump, the y velocity is negative.

#

I don't think you float for even a tick.

frigid ember
#

Gotcha. After switching to entity.getLocation().getY();, it appears that the remainder is still NaN

#

I'm at Y 88.0, which resolves as 88/(1/16)=5.5

radiant pollen
#

Maybe change the (1/16) to (1.0/16.0)

#

It could be something weird with integer division. Honestly, I have no idea. Any number modulo 0 is just that number so I don't know why it would return NaN.

frigid ember
#

That seemed to work! Thank you so much @radiant pollen 🙂

radiant pollen
#

You're welcome!

agile rock
#

Im creating a custom enchant plugin. Whats the most efficient way to give speed 2 to a player who has the "Speed" custom enchant?

real valve
#

Player#addPotionEffects

agile rock
#

Do i give that to the player everytime they move?

real valve
#

That's probably the signature.

#

No, if it's on armor, for example, you will give it to them when they equip the armor and remove it when they remove the armor

agile rock
#

Hmm, using InventoryClickEvent?

final verge
#

could use this

#

I have a PR up for spigot to add an actual EntityArmorChangeEvent

real valve
#

Armor is a tricky thing because dispensers can equip armor, you can right click while holding armor, you can use inventory clicks.... ^^

final verge
#

but it's still under going review

real valve
#

I have a suggestion up for an EntityEquipmentEvent, probably similar

agile rock
#

How would I implement EntityArmorChangeEvent into my plugin?

final verge
#

It's not officially in spigot yet

#

would need to use a workaround atm such as the first github link i sent

#

also @real valve i linked the PR if you wanna look and see if that has everything that you thought of

agile rock
#

How could i add ArmorEquipEvent

real valve
#

You could clone the repo into your plugin

agile rock
#

K

#

If Im on 1.8 can I still use your repo

#

@final verge

final verge
#

the github one I linked I think works on 1.8

agile rock
#

Whats the DispenseArmorEvent for?

final verge
#

worst case you can use it as a base and modify the code to fix any issues

#

for when armor is equipped via dispenser?

agile rock
#

gotcha

frigid ember
#

anyone know the like %{xp} thing for like gui sidebar things?

final verge
#

?

agile rock
#

Yeah the BlockDispenseArmorEvent is not available on 1.8

frigid ember
#

like the side like scoreboard thing

#

called Title Manager is the plugin i use

#

actual armor change event pog

agile rock
#

Also how would I be able to make custom enchant books and make them able to be applied via anvil?

subtle blade
#

It could be something weird with integer division
For reference, integer division will truncate the result

#

No decimals or anything

radiant pollen
#

Yeah, but it's still weird. I didn't think it would fix it. @subtle blade

#

Truncating that would result in 0. AFAIK modulo 0 is still a number.

#

🤷‍♂️

subtle blade
#

Not gonna lie, I saw "integer division" and didn't read much else lol

#

So my message was at in response to that

radiant pollen
#

Gotcha

stable egret
#

is there anyway to fix the nametag when i drink invisible potion

#

some player can see it even when im invisible

hallow surge
#

@stable egret hm the fact only some players can see it makes me think they may have an illegal modification

#

It's a vanilla mechanic for nametag hide when invis so if they see your nametag either a plugin enables it or they are using a modification (or a glitch depending on your version)

raw atlas
#

my minecraft spigot server crashes Spigot version: git-Spigot-eb3d921-2b93d83 (MC: 1.12.2)

buoyant path
#

@raw atlas im pretty sure they will need to know more than that

frigid ember
#

Hello,

I'm looking for some help to allow my ravager entity to rotate while moving. Currently, the player riding the ravager can rotate the ravager's head and body (see line 48.) While the ravager is in motion (with the player using WASD,) the ravager's rotation resets to a default position. How might I fix this during the movement?
Full code: https://hastebin.com/idexeludow.java

Thank you!

tiny dagger
#

Yaw and pitch

#

Let me understand

#

You're doing this in the bukkit api....

#

If you're using velocity you're gonna need to send rotation packets as often as you can

frigid ember
#

How might I send more?

#

Would I just duplicate entity.setRotation(playerEyeYaw, playerEyePitch); in each if statement?

tiny dagger
#

no

#

during movement

#

otherwise use entity controller to move your entity

lilac echo
#

hi i have problem in the spigot page when someone update a plugin i'm not getting any notifications

#

@atomic rapids

tiny dagger
#

press watch resource?

frigid ember
#

@tiny dagger I'm having trouble understanding what you mean - to clarify, I'm using ProtocolLib to handle the packets

tiny dagger
#

oh protocollib

#

i haven't used that

frigid ember
#

Ah, darn

blissful verge
#

How can I make a plugin which grants the player temporary flight when he consumes an item

lilac echo
#

@tiny dagger when i click watch this resource will i get notifications?

peak marten
#

Ladies & Gentlemen, I just had a discussion with a starting developer, who said that you could use a Enum for singleton instead. Does anyone have experience with this? I'm used to using the pattern, and as long as you initialize the first instance of your singleton on load or for spigot in the onEnable() method ,there should be no issues whatsoever using threads.

Any experiences?

sturdy oar
#

mhh

#

they're very different in my opinion

peak marten
#

Well, I just did some investigation, and seems it can be used indeed. I didn't knew that to start of.

#

And there are disadvantages as also stated in the documentation

#

and it also say's "This is also a good way to have singleton with minimum effort."

wide gate
#

Java enums are nothing more than strictly enforced singletons

#

that can't extend any class

fleet burrow
peak marten
#

Well, Singleton is only used to store data in an instance in a non static way. So I don't see a point of extending it at all. So this is more of a preference ?

sturdy oar
#

that's kotlin?

fleet burrow
#

Yeah

sturdy oar
#

mh i haven't studied Kotlin generics yet so i don't really know

#

how they work

hoary parcel
#

I find enum Singleton's really ugly

#

But it's personal preference

radiant pollen
#

^

hoary parcel
#

Then again, I use guice to manage my Singletons most of the time

#

Or just a simple getInstance method with a static instance field and a private ctor 🤷

peak marten
#

Exactly

#

That's what I do

#

I use the singleton pattern

hoary parcel
#

That has the benefit of being able to be mocked in unit tests easily

sturdy oar
#

also no lazy initization

hoary parcel
#

This is all the singleton pattern, lmao

peak marten
#

In fact, I might know a dependency

hoary parcel
#

Just different impls of said pattern

peak marten
#

Can you still send data to a Singleton based no Enum?

#

using the parameters

#

I guess not

hoary parcel
#

Wut?

peak marten
#

Yeah for example

#

Your singleton requires an instance of your main class

#

can you do that if it's based on an enum?

#

I guess not?

hoary parcel
#

Well, your main class is a Singleton too, isn't it ;)

peak marten
#

Yes

hoary parcel
#

But yes, generally that's harder

#

Just use guice

#

😂

peak marten
#

Alright, perfect

sturdy oar
#

MiniDigger

#

the main class tho can't be a real singleton

#

because constructor can't be private

hoary parcel
#

Wtf is a real Singleton?