#help-development

1 messages · Page 1813 of 1

primal kite
#

@spare marshdepends on the question. if it is dev related the ask here, server related would go in #help-server , outside of that then try #general

primal kite
#

random question for the devs/contributors. I had an issue a few days ago with the Entity.remove() method. md_5 was online and said the issue was indeed a bug and i should report it. I was finally able to get around to submitting it today and he had already corrected it. I am not very fluent in searching through the changes logs and, to avoid me doing this in the future, would anyone be willing to school me in searching/viewing changes to the patches?

sullen marlin
young knoll
#

Ooh, fancy site

timber whale
#

How would i make a full bed? If i try just spawning the block, it turns into just one part of the bed so how would i make it into the full 2 block bed

young knoll
#

Gotta place both parts

timber whale
#

wdym

#

do you just make the location two blocks long

young knoll
#

Beds are made of 2 blocks, you have to place both with the appropriate data

timber whale
#

ok and how would i place the other part of the bed

#

like whats the data

#

theres only one Material for a bed

#

but theres diff colors of beds

primal kite
#

@timber whalegive me a moment i jsu had code for that due to the POI issue md_5 just fixed.

young knoll
#

Think I’ve come across an issue too, I should probably fix it

timber whale
#

nah this actually annoying

primal kite
#

how do you post code blocks on here?

timber whale
#

just go with pastebin

#

probaly safest option

#

or the

#

` stuff

young knoll
#

?paste

undone axleBOT
primal kite
#

i am on a work computer and would like a native way as I have seen done in the past. I have my computers locked down pretty hard due to my job.

timber whale
#

so

#

if you put three of these ` symbols next to eachother and then type java you can paste it in there (make sure to enter after typing java no spaces)

buoyant viper
#

```java
<code>
```

timber whale
#

that

primal kite
#

thanks!

#

the code I used to set a bed

my set bed method
    public void setBed(Block start, BlockFace facing, Material material) {
        for (Bed.Part part : Bed.Part.values()) {
            final Bed bedData = (Bed) Bukkit.createBlockData(material, (data) -> {
                ((Bed) data).setPart(part);
                ((Bed) data).setFacing(facing);
            });
            start.setBlockData(bedData);
            start = start.getRelative(facing.getOppositeFace());
        }
    }
timber whale
#

thank you

primal kite
#

np

granite burrow
#

Whats the diffrence between
runTaskLaterAsynchronously
and
runTaskLater

young knoll
#

One is async

quaint mantle
#

one isn't

karmic grove
#
@EventHandler
    public void OnBlockBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        Block block = event.getBlock();
        if (block.equals(Material.STONE_BUTTON)) {

            block.getDrops().clear();
            player.getLocation().getWorld().dropItem(player.getLocation(), new ItemStack(Material.HONEY_BLOCK));
        }
    }```
#

this should drop a honey block and not drop a button when a stone button is broken but nothing different happens

tardy delta
#

Blocks.getType

#

== Material.stone

karmic grove
#

ooooo

tardy delta
#

Button

karmic grove
#

ahhhh that makes sense lol

#

the stone button still drops any idea why that dont work

primal kite
#

i would investigate the cancelEvent and BreakBlockNaturally stuff.

karmic grove
#

i dont want to cancel the event

#

that would cancel the break

primal kite
#

only because i have had issues with the .clear() on getDrops.

karmic grove
#

ive used cancel event what does Break block naturally do

primal kite
#

you can replace the "Material" on block break to what you want it to be. IF it doesn't seem to "eject" from the block the right way you can leverage the BreakBlockNaturally to get it to "spawn" right as a block break drop

manic furnace
#

How can i check if somebody is using kill aurp

vague oracle
#
if(event.getEntity().getKiller().isUsingKillAura() {
        event.getEntity().getKiller().ban("Hacker");
}
karmic grove
#

^

tacit drift
#

pretty much every anticheat does that

desert loom
#

Anyone know a fix for the search function in jd-gui not working with a 1.18 spigot jar?

quaint mantle
#

chance

desert loom
hidden cloak
#

is using get methods like getString for the config reading from the hard drive or is it already loaded?

rough basin
#

What is the result of ProjectileLunchEvent.getEntity ?
Projectile? or Shooter?

worn tundra
#

Well, it's not ShooterShootProjectileEvent

random epoch
worn tundra
#

If you're looking to get the shooter, first check whether that projectile has one, and then try casting

summer scroll
#

Projectile#getShooter

worn tundra
#

^

granite burrow
#

How can I restart a BukkitRunnable?
My code:

public class RepeatingReminder extends BukkitRunnable {
    private static final Main plugin = Main.getPlugin(Main.class); // Get this from main

    public void schedule() {
        runTaskTimer(plugin, 0L, 20L);
    }

    @Override
    public void run() {
        // Get everyone online
        for(Player p : Bukkit.getServer().getOnlinePlayers()) {
            p.sendMessage("test");
        }
    }
}
#

I basically wanna stop the runnable then restart it but with a different time that will be coming from the config

granite burrow
#

says its already scheduled
Already scheduled as 147

worn tundra
#

Because it's running constantly as a timer

#

Are you cancelling it?

regal dagger
#

anyone?

worn tundra
regal dagger
#

and I tried the Dcheckstyle.skip

#

but it didn't work

worn tundra
#

You aren't looking at the solution

regal dagger
worn tundra
#

Have you tried looking after the first answer?

granite burrow
worn tundra
granite burrow
#

when I check if its canceled using .isCancelled() and it says true, but enabling it throws the error

worn tundra
#

Try creating a new instance of that runnable

#

And run that

#

Make sure to cancel the old one

#

Depending on what you wish to achieve, of course

granite burrow
regal dagger
worn tundra
#

Are you telling me it's an unfixable problem?

regal dagger
worn tundra
#

I've never had it

regal dagger
#

I hate maven so I don't use it when I make my own stuff

worn tundra
#

Maybe look at this

#

What do you use

regal dagger
worn tundra
#

When you make your own stuff

#

You said you hate maven

regal dagger
#

Oh

#

I just compile it straight from IntelliJ

#

as in build artifacts

#

just a plain java project

worn tundra
#

Which isn't maven?

regal dagger
#

Don't think so

#

I never wrote up a maven file so

worn tundra
#

Dependencies are jars?

regal dagger
#

Yes

worn tundra
#

oh lol

regal dagger
#

I just import the spigot/bungee/ext. jar

worn tundra
#

😬😬

#

How about no

#

I mean you can do it that way

#

Just that it might not be the best standard

regal dagger
#

It's not included in the actual build file because you can uncheck that

regal dagger
granite burrow
#

im dumb, it worked @worn tundra

worn tundra
#

Neither is Maven

worn tundra
regal dagger
#

I mean really the only changes I made to the bungee as of now is a few strings

regal dagger
worn tundra
#

Ohh waitt

granite burrow
#

Maven is realy eassy to use, you can make a plugin fast with it. And with intellij theres a minecraft addon to make developing on it easier

regal dagger
#

I usually compile simple projects with a few lines of code so it's difficult to tell

worn tundra
#

You're working on bungee?

regal dagger
worn tundra
#

Not a plugin?

#

Ahh

regal dagger
#

No

#

xD

worn tundra
#

Didn't notice

#

my bad

worn tundra
regal dagger
#

I plan to make more changes, this is just some basics

#

I don't like people in general knowing the versions of the software we run

worn tundra
#

Why? ;D

regal dagger
# worn tundra Why? ;D

Opens the door to version specific exploits imo and it just looks unprofessional (I have no idea why I think that but I do)

worn tundra
#

Which is only a problem if you're running outdated builds

#

Or versions

regal dagger
#

Yeah but it's still a nice peace of mind

#

and I plan on adding some stuff to the bungee anyways

tacit drift
#

@regal dagger do /version on Hypixel

tacit drift
#

/ver

#

i remember at least that it worked

#

and it returned the version of bungeecord

regal dagger
quaint mantle
worn tundra
#

either way the command is just blocked

regal dagger
quaint mantle
#

Security by obscurity 👎

regal dagger
#

I also want to do something like this when I figure out how java DefinedPacket.writeString( bungee.getName() + " <- " + serverBrand, brand ); // server instead of brand

regal dagger
tacit drift
#

¯_(ツ)_/¯

regal dagger
tacit drift
#

well, it's a fork of latest build of spigot 1.8.8

quaint mantle
#

but they said it is heavily modded

#

so it would be like their own jar already instead of it still spigot

pastel stag
#

what was the replacement for GetItemInHand

#

??

chrome beacon
#

Players have two hands now

quasi flint
#

getStackinHand

#

if that method exists

chrome beacon
#

It doesn't

#

It's getItemInMainHand or getItemInOffHand

quasi flint
#

oh too much fabric for me

native gale
#

Hello, the question maybe not spigot related, but anyway. How do you do multithreading in spigot in proper way? I am not primarily Java developer, so I just do

#
new Thread(() -> { /* code */ });
eternal oxide
#

Everything in Spigot is single threaded, except for chat

native gale
#

And call it a day

eternal oxide
#

?scheduling

undone axleBOT
native gale
#

Maybe there are more proper ways?

native gale
eternal oxide
#

there are seperate sync and async tasks

stable inlet
#

What do i use to get the light block?

eternal oxide
#

light block?

stable inlet
#

Yes

eternal oxide
#

what light block

stable inlet
#

wut

#

its an invisible light block

eternal oxide
#

What are you calling a light block?

#

are you refering to the light level at a location?

stable inlet
#

no

eternal oxide
#

Explain better then

stable inlet
#

dis

native gale
eternal oxide
#

is that a mod?

stable inlet
#

Idk

native gale
eternal oxide
#

ah ok, I've not played 1.17

stable inlet
#

Can i get it on 1.18

native gale
stable inlet
#

Thx

#

I needed that

paper falcon
#

Hello!
I made 4 packets, is there a way to put them in a List and send them all at once?
I'm kinda lazy to send every packet each..

 List<Packet> packets = new ArrayList<>();
                    packets.add(addPlayerPacket);
                    packets.add(spawnPlayerPacket);
                    packets.add(equipmentPacketMainHand);
                    packets.add(equipmentPacketOffHand);

                    //send
                    Bukkit.getOnlinePlayers().forEach(player -> ps.send(packets));
``` something like this?

and `ps` is `ServerGamePacketListenerImpl ps = craftPlayer.getHandle().connection;`
eternal oxide
#

Use the secheduler if you can but theres nothing wrong with using Futures

native gale
#

Okay, thank you!

stable inlet
#

Wot

#

It says unknown item

stable inlet
#

Yeah but how do i get it

eternal oxide
#

get it? do you mean create an ItemStack?

#

new ItemsStack(Material.LIGHT,1);

stable inlet
#

wut

#

is that a conmand?

eternal oxide
#

No, this channel is for Spigot plugin development. Everything in here will be Java code or IDE related

stable inlet
#

o

#

sorry :p

eternal oxide
#

np 🙂

#

there is a command to spawn it on teh first page I linked though

native gale
stable inlet
#

nothing

native gale
#

perhaps /minecraft:give?

#

Which version are you at, this feature is only accessible after 1.17

stable inlet
#

1.18

native gale
#

I just tested this command in singleplayer creative world on 1.18, it works fine

stable inlet
#

Thats wierd

native gale
#

Also, you should probably ask this in #help-server and not here

tribal holly
#

Hi, is it possible to cancel a specific trade of a pnj ? (like if a player want to buy a chain armor it cancel the trade)

main nacelle
#

ye

#

just listen to Inventory click event

#

check if the inventory type == Merchant

#

then check slot type == result

#

and then u do ur thing

tribal holly
#

okay nice thx

noble lantern
#

Does anyone know how i can say, make a random item like a conduit have the same mining speed as a wooden pickaxe or similar without using a haste effect?

fierce jolt
#

Okay so I have a little hashMap that couples a string to a class

#

however I want to add aliases. Including those in the hashmap would be no problem

#

but I sometimes need the unique values. Would it be better to sort them out then, or just to keep a list next to the hashmap?

tardy delta
#

what is this for?

#

theres nothing inside

eternal oxide
#

its an identifying Interface

#

an Entity may be a Creature but it might not be an NPC

tardy delta
#

ah ok

misty current
#

Listener is also an identifying interface

ivory sleet
#

RandomAccess also

#

And Serializable (:

pastel stag
#

uhm.... can anyone tell me why my plugin suddenly shows 4,289 downloads on its current version less than 2 hours after posting an update??

tardy delta
#

wait an abstract class doesnt have to implement interface methods

eternal oxide
#

no

#

because an abstract class is not an implementation

tardy delta
#

yea i thought it had to have those methods as abstract

eternal oxide
#

only when it gets to implementation do all abstracts have to be implemented

#

poor wording, but you shoudl get the point

tardy delta
#

yea

#

👍

robust fjord
#

hi

rough basin
#

Is it possible to set Entity's target without invoke EntityTargetevent?

spiral light
#

Nms

echo hound
#

how would you safe sql data in json file?

#

in yaml you could do like setString("SQL.Host","localhost")

#

how do you do path in json?

tacit drift
#

Pretty much, just search on how to use Gson

echo hound
#

?

junior briar
#

i'm running the latest eclipse 2021-09. it keeps showing Missing property "api". in my plugin.yml, which is annoying.
anyone knows how to deal with it or disable the validation?

main: com.meeku.tutorialPlugin.SpigotBlankPlugin
name: SpigotBlankPlugin
version: 1.0.0
api-version: 1.17
eternal oxide
#

1.17 not 1.17.1

junior briar
#

fine. but it still doesn't go right.

quaint mantle
#

Just specify the api version 😳

junior briar
#

i did.

quaint mantle
#

Oh

#

Sorry

eternal oxide
#

Eclipse doesn;t care whats in your plugin.yml. Where are you seeing this Missing property?

junior briar
#

left near the main, also in Problems view.

eternal oxide
#

I'll need to see the actual error as Eclipse shoudl not care one bit whats in your plugin.yml

pastel stag
#

anyone ever see a huge spikein plugin downloads out of nowhere? im talking going from like 10-20 per version to 4,000 in a few hours

junior briar
#

i cannot upload a screenshot. 😦
eclipse doesn't show any detail about this except those words above.

quaint mantle
#

does anyone know how i can make a sphere of floating water

#

without the water spreading

#

is this still possible? i havent seen anything since like 1.4 release

rough basin
#

Is it possible to set the attacker who just attacked the Entity as the Entity's Target?

wide solstice
#

Bump, it started working for a little bit, but giving me messages like: "The bytecode does not match the sources". Has anyone else had this happen to them?

#

But now it's back to square one

paper falcon
#

otherwise, NPC disappears after relogging

#

where and what should I add? I only found solutions online that aren't for 1.18

tardy delta
ember estuary
#

should you use static for stateless helping methods ?

#

or is it in any way a bad practise?

tardy delta
#

for util methods

ember estuary
#

yeah

tardy delta
#

if that class has no state it wouldnt really make sense to instantiate it

ember estuary
#

true

tardy delta
#

i like to have a private constructor for util classes

paper falcon
tardy delta
#

big code

paper falcon
#

could you provide an answer to what I asked?

ember estuary
#

what about stateless helping methods that are in the same class as other normal code?

for example

public void sendMessage(Player p, String message) {
   p.sendMessage("Some Prefix " + message);
}

Is it bad to make that static?
Cuz i always use static to indicate its stateless, or/and to make it useable from elsewhere without having to make an instance

tardy delta
#

i would put it in a util class

ember estuary
#

hmm true, should probably use more classes

#

i just divide my code using comments haha

tender shard
#

anyone has any idea on how the content of the "Documentation" thing will look on the descr page?

tender shard
#

the one and only valid reasoning imho is: does it need to access any instance properties? yes -> non static, no -> static

shrewd pier
tender shard
quaint mantle
#

1.16 supports java 17?

tender shard
#

yes

quaint mantle
#

Ok thanks

proud basin
#

what’s the min gamma mc lets you go with the slider?

summer scroll
#

How can you get location 2 blocks in front of player based on their body?

quaint mantle
#

Static Utility method are absolutely ok

summer scroll
#

yeah i'm blind about that

#

i use this, but it follows where player is looking at

Location npcLocation = player.getLocation().add(player.getLocation().getDirection().multiply(2));
quaint mantle
#

yeah, isnt that right?

summer scroll
#

so basically i want to spawn a npc 2 blocks in front of player

#

with that, if the player is looking straight down

summer scroll
#

the npc will spawn inside the block under

quaint mantle
#

oh

quaint mantle
#

you could set the y on vector to 0

#

i believe

summer scroll
#

or set the Y the same as the player?

quaint mantle
#

no

#

vector xyz is not location's xyz

summer scroll
#

i'm using the player location

quaint mantle
#

ok

summer scroll
#

it fixes the player spawning inside a block

#

but if i'm looking down, it will spawn on the same block

#

as the player standing

quaint mantle
#

Even with setting y to 0?

summer scroll
#

yeah

#

let me try something

#

woah i did it

tardy delta
#

why do locations need to be cloned?

Location original = getLocation();
        Location cloned = original.clone().setDirection(target.getLocation().subtract(original.clone()).toVector());
ivory sleet
#

They don’t really

#

However since many of their mathematical operations only mutate its state rather than returning a copy it becomes a problem when you use Locations in for instance hashmap keys

#

(Which in itself might cause a memory leak)

quaint mantle
#

locations and vectors should be immutable ☹️

tender shard
junior briar
#

does spigot or minecraft teleport player to a safe location when they're gonna respawn upon a dangerous place?

tender shard
proud basin
#

wym just try it

#

im asking what’s the minimum gamma

tender shard
#

I mean - set your gamma to the lowest value with the slider, and then check what your config value for gamma is

#

then you know what's the minimum gamma

proud basin
#

Where is this config file located?

tender shard
#

probably in .minecraft I think

#

let me check

tacit drift
#

watch antvenom's videos

#

of breaking minecraft

tender shard
#

however be sure to CLOSE minecraft before you check

#

I think it only saves the file when you properly close MC

junior briar
#

but afaik it will at least teleport u to the top block if the spawn point is underground.
i need that solution to find a safe location.

tender shard
#

@proud basin

#

0

tender shard
#

I just checked

tacit drift
#

it's 0.0 i think the min

tender shard
#

0 is the min gamma, yes

#

the vanilla slider goes from 0.0 to 1.0

proud basin
#

ok dope thanks

tender shard
#

np

tender shard
#

paper does that, but it's configurable

junior briar
tender shard
#

regular spigot teleports you to exactly the location you specify as parameter

junior briar
#

when i said "teleport", i meant "respawn". sry about that.

tender shard
#

ooh

#

yeah vanilla already handles that IIRC

#

I can check it, one sec

junior briar
#

yes, i had tried that.

#

but will there always be safe? i'm not sure

tender shard
#

I just set my whole spawn chunks to lava

#

and I keep respawning in lava

#

so I basically set everything from -100,0,-100 to 100,256,100 to lava and yeah, I die everytime on respawn again

junior briar
#

have u tried place a solid block at the top?

tender shard
#

I will try

#

one sec

junior briar
#

btw which jdk are you guys running for development zulu or adopt?

tender shard
#

works with only one block

tender shard
mighty pier
#

what is the difference between gradle and maven?

tender shard
#

that's like

#

what's the difference between linux and windows

#

both are build management systems etc

#

but they are inherently different

mighty pier
#

ok

tender shard
#

I'd recommend maven but that's just personal taste

#

I wrote a tutorial for getting a basic maven setup for spigot if you need one

#

@mighty pier

junior briar
#

i always want a setup for spigot which contains mapped server source codes.

quaint mantle
#

Need Expireincd Builders/dev/admin dm me for more info serv info 32ram 8 core discord server is done allredy

tardy delta
#

?services

undone axleBOT
dense notch
tardy delta
#

Bukkit.createBossBar

karmic grove
#

?SPIGOT1.18

#

?spigot1.18

#

wheres download link lol

#

the one i got dont work

mighty pier
#

?

#

do you want the server jar?

karmic grove
#

yea

mighty pier
#

its on the website

karmic grove
mighty pier
#

probably

karmic grove
#

when i try to use it ...... yeaaa

tacit drift
karmic grove
#

oh

tacit drift
#

you need to build the server jar your self

#

?buildtools

#

wait

karmic grove
#

is it not for 1.18 yet cuz i didnt have to do this before lol

tacit drift
#

if you use it as a maven dependency

karmic grove
#

i dont use maven

tacit drift
proven river
#

I'm fairly new to making plugins, I couldnt find anything on the subject I want to find.
How would I run another command from another plugin, for example: If someone dies it will run /broadcast [message]

upper lark
#

Does anyone know how to use .getId() and .getDataWatcher in 1.18?

tacit drift
slim cairn
#

How would I drop Items on player death

#

Not items from their inventory

#

just items

native gale
#

Is there a way to load an external library without shadowing it into the plugin?

slim cairn
#

Whats the benefits

mighty pier
native gale
proven river
mighty pier
#

np

slim cairn
native gale
#

Also, shadowing kinda defeats the modular nature of Bukkit in my opinion, I feel like there should be a better way

karmic grove
#

?java17

undone axleBOT
karmic grove
#

for myself btw

cursive loom
#

Hello I have a problem with this line if(Bukkit.getBanList(BanList.Type.IP).isBanned("IP")){ return false but when I check in the banList I have the good IP, who have a exemple for me or anyone can help me ?

thx for advance

grim ice
#

doesnt ban list return a String list

tender shard
dense notch
#

Ty

tender shard
#

PacketUtils.sendPacket(player, new ClientboundSetEntityDataPacket(((Entity)entity).getId(), ((Entity)entity).getEntityData(), true));

#

DataWatcher is getEntityData

cursive loom
tender shard
upper lark
#

Legend, thanks man!

tender shard
#

np 🙂 btw what was your problem with getId?

#

getId works fine for me

hybrid spoke
#

it spams my laptop screen

upper lark
hybrid spoke
#

thanks

tender shard
#

They are not called EntityArmorstand in remapped mojang

#

correct class name in remapped is net.minecraft.world.entity.decoration.ArmorStand

grim ice
#

i think

cursive loom
#

Thats work```
if(Bukkit.getBanList(BanList.Type.NAME).isBanned(args[0])){
Bukkit.getBanList(BanList.Type.NAME).pardon(args[0]);


but thats doesn't work 

if(Bukkit.getBanList(BanList.Type.IP).isBanned(FILE_UTILS.getIp(args[0]))){
Bukkit.getBanList(BanList.Type.IP).pardon(FILE_UTILS.getIp(args[0]));



public static String getIp(String name){
    File file = new File("plugins/H-Moderation/PlayerData/"+ name+".yml");
    FileConfiguration config = YamlConfiguration.loadConfiguration(file);

    return config.getString("Informations.IP");
}
grim ice
#

store the uuids

#

then get the names

#

wait

cursive loom
#

ok I got try

grim ice
#

no

#

use the

#

ok here

#

store uuids

#

then get the player from uuid

#

and get the player ip

#

and check for it

fresh drum
#

Hey !
Do you know how to remove one Biome using NMS in 1.9+ ?

hybrid spoke
#

what kind of remove are you speaking of?

#

and for what would you need NMS

fresh drum
#

I want te replace all Oceans by Plains 😄

fresh drum
zealous osprey
#

Does "ShapedRecipe#setIngredient" only support Materials and no Itemstacks ?

grim ice
#

it does support itemstacks but it wont work well with the Crafting table knowledge book

#

iirc

zealous osprey
#

Ima try it out

hybrid spoke
zealous osprey
#

damn

#

crap, so I'd need to make my own crafting system

hybrid spoke
#

if there is no other way, you would need to go over the PrepareItemCraftEvent

zealous osprey
#

oh ?

#

Ill try

grim ice
#

you're wrong

hybrid spoke
grim ice
#

it supports RecipeChoice

hybrid spoke
#

which is an internal predicate and stated as This class is not legal for implementation by plugins!

grim ice
#

Well yeah

#

but it works

zealous osprey
#

didnt for me tho

hybrid spoke
#

ah wait, i oversee ExactChoice

grim ice
#

then

zealous osprey
#

atleast not with the RecipeChoice

hybrid spoke
grim ice
#

Yes

zealous osprey
#

I have that exact item and it isnt working.
Wait, do you mean same meta or something else ?

grim ice
#

show the code

zealous osprey
#

This is from the class that implements the crafting recipe

grim ice
#

ur using it wrong then

hybrid spoke
#

what is new BlobWand().getItem

grim ice
#

godcipher that isnt the problem

#

lol

zealous osprey
hybrid spoke
#

thats not how it works

#

you will have to create a new RecipeChoice.ExactChoice instance with your itemstack in it

grim ice
#

RecipeChoice.ExactChoice(itemStack)

#

this

upper lark
hybrid spoke
grim ice
#

lol

#

he was casting the RecipeChoice

hybrid spoke
#

exactly what i said xD

grim ice
#

you didnt need to know what was the BlobWand.getItem()

zealous osprey
#

Well, anyways it works, yey and thx
Gotta check if it is realiable tho ?
Any words of advice before I use this and might need to change it lateron ?

hybrid spoke
#

in what way realiable? i mean, you should be able to craft it huh

#

well, it depends for what it is.

zealous osprey
#

I just want to add recipes that require special/custom items, thats prettymuch it

hybrid spoke
#

so then, if it works, it works

zealous osprey
#

ig so

tender shard
hybrid spoke
tender shard
grim ice
#

Stringgjwefnonawef lol = string;

#

then asking what did u write in the lol string

#

shit example but yes

hybrid spoke
#

and what would you've done if the getItem method would've returned an ExactChoice object but unnecessarily casted RecipeChoice anyways?

grim ice
#

that wouldve worked

#

lol

hybrid spoke
#

its like a stacktrace, you start searching the problems from back to front.

grim ice
#

not when its extremely obvious

#

its like scanning an entire event listener cuz it didnt work while it wasnt even registered in the main class

quaint mantle
# tender shard yes

Are you sure? I just ran BuildTools using Java 17 and it said it requires versions between 8-14. Maybe I’m doing something wrong 😑

hybrid spoke
# grim ice that wouldve worked

not really, it could've been anything and you would still stuck at the "why doesn't that work? it should work, its an ExactChoice"

tender shard
hybrid spoke
tender shard
#

get the latest version of BT

quaint mantle
tender shard
#

can you show the output pls?

grim ice
hybrid spoke
grim ice
#

its an example

hybrid spoke
grim ice
#

it is the cast

#

he casted the RecipeChoice

hybrid spoke
#

what isn't wrong, just unnecessary

grim ice
#

it is wrong

hybrid spoke
#

the cast just prevented seing the error

#

the problem was in the method

grim ice
#

you said it isnt wrong

#

it is wrong

quaint mantle
hybrid spoke
grim ice
#

Yes

hybrid spoke
#

upcasting is also an appreciated way as you just use what you need

grim ice
#

but the method name is pretty self explanatory

hybrid spoke
mighty pier
#

how do i get the first 2 characters of a variable?

grim ice
#

getItem wouldnt return an ExactChoice will it

#

RecipeChoice is

hybrid spoke
#

it is a static class inside RecipeChoice

#

RecipeChoice is an interface

grim ice
#

oh right

#

my bad

cloud sparrow
#

My server was going great, did a reboot and I got an error: "Out of Memory: Killed process 1365"

opal juniper
#

add it to the gitignore

stone sinew
visual tide
#

uh

grim ice
#

why are we arguing about that either way

opal juniper
#

lol

visual tide
#

gitignore gitignore
hum

hybrid spoke
opal juniper
#

you should include the pom fyi

stone sinew
#

Has file paths.

grim ice
#

well its pretty self explanatory that getItem wouldnt return an ExactChoice

#

and if it did it wouldve worked

hybrid spoke
#

define "wouldve worked". compiled? didnt crash or throw an exception? it already did before with the ItemStack. he said it doesn't work to craft, so you would've need to check his approach and items when crafting

tardy delta
#

casting this to object says its redundant

hybrid spoke
#

btw i gtg now

queen fox
#

I am trying to extend the JavaPlugin in my Main Method in Spigot Version 1.18 but it cant find this implementation. It tells me "JavaPlugin cannot be resolved to a type" can someone help me?

grim ice
#

do you have Spigot imported

lavish hemlock
queen fox
grim ice
#

are you using maven

queen fox
#

I am using the Jar File but i think i know the problem. I am trying to Build the Jar File with the Spigot Buildtools because i just downloaded the Spigot 1.18.jar from the Internet

paper falcon
#

does anyone know why my NPC keeps disappearing after reloading the server

smoky oak
#

how do i set a specific player (Player object present) as the cause in a damage event?

#

as if that player attacked the entity damaged

burnt wedge
#

Can somebody point me to a resource on using mojang mappings for development. I can't find anything

tardy delta
#
<repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>```
lusty cipher
#

how can I get the server softwares name? Say CB, Spigot, Paper, ...

proud basin
#

Like you want to know if they are using spigot etc…

karmic grove
#

if you want to do ^ f3 screen should say

waxen plinth
#

Bukkit.getVersion() or getServerVersion I think

lusty cipher
trim estuary
#

Is it possible to move an item frame of the grid?

proud basin
quaint mantle
#

Bukkit.getName

atomic shard
#

is there any armor equip event? i couldnt find one in the docs

ivory sleet
#

not in spigot yeah

#

believe paper got, and apart from paper there's some lib which implements one using other existing spigot events

grim ice
#

ngl its weird spigot hasnt made that yet

#

they should definitely add that

quaint mantle
#

same with full component support

misty current
#

how can I set an npc skin if I have the value and the signature using citizens?

#
NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, ChatColor.RED + "" + ChatColor.BOLD + "Warden");
SkinTrait skin = CitizensAPI.getTraitFactory().getTrait(SkinTrait.class);
npc.addTrait(skin);
skin.setTexture(GuardValues.WARDEN.TEXTURE, GuardValues.WARDEN.SIGNATURE);

current code

atomic shard
#

How do i prevent someone from equipping an item?

jade grove
#

how would i ban a player? the method Player#setBanned is deprecated, is there an efficient alternative?

smoky oak
#

what's the best Key -> Object map/set for a relatively low number of keys with relatively big objects?

#

in terms of overall efficiency

chrome beacon
#

Yes

waxen plinth
#

No what

#

It would be 1 ^ 0.25

chrome beacon
#

Oof

#

How did I not notice that

burnt current
#

Hey I have a quick question about attribute modifers. I try to change the attack speed of a sword in the ItemMeta with an attribute modifier. Unfortunately, based on what I found on the Internet, I still don't understand how it actually works or how I have to specify everything there. Anyone who happens to be able to help me with an example?

chrome beacon
#

First parameter is base second is exponent

lapis lark
#

100 * Math.pow(level, 1.25D)

quaint mantle
#

what??

lapis lark
#

Idk what you do

lapis lark
lapis lark
#

What are trying to do by powing to 1.25

lapis lark
#

Interesing idea with powing to 1.25

smoky oak
#

which is faster? (NamespacedKey key)

if(!key.getNamespace().equalsIgnoreCase("Plugin"))
                continue;
if(key.getNamespace().equalsIgnoreCase("Plugin")){
    //Code here
}
eternal oxide
#

both the same

smoky oak
#

ok

ivory sleet
#

implicit else code usually compiles down to nested ifs just to optimize it a bit

stone sinew
eternal oxide
#

compiled it makes no diffence, its just a step

hybrid spoke
#

any1 knows why the PlayerInteractEvent is called twice for a rod?

candid galleon
#

Left+Right hand

#

Check the hand

hybrid spoke
#

just listening for one hand

atomic shard
#

Is there anything i'm doing wrong while comparing uuids?

Bukkit.broadcastMessage( nbti.getUUID(NBTTags.soulboundPlayerUUID.tag()) + "\n" + p.getUniqueId() );
Bukkit.broadcastMessage( "match:" + nbti.getUUID(NBTTags.soulboundPlayerUUID.tag()) == p.getUniqueId());

Console says:

[21:03:20] [Server thread/INFO]: f36a423a-875a-4ba8-bf9c-ec41c9857c17
[21:03:20] [Server thread/INFO]: f36a423a-875a-4ba8-bf9c-ec41c9857c17
[21:03:20] [Server thread/INFO]: match:false
candid galleon
#

I think I ran into a similar issue before, just had to delay the triggering

hybrid spoke
#

since rod triggers the event twice, i can just cancel the second call when a first one has made. but why does it fire twice huh

eternal oxide
#

do you have torches in your offhand?

hybrid spoke
#

nope

#

and it also happens on 1.8

#

apparently it fires the event for every air action once.

proud basin
#

so I'm getting a nullpointerexception here this.sidebarWidth = fr.getStringWidth(sidebar.getDisplayName()); and I've done some testing and sidebar.getDisplayName isn't null and fr isn't null so im confused on what is

grim ice
#

stringWidth is null maybe

#

wait thats a method?

proud basin
#

yea

eternal oxide
#

fr or sidebar have to be null

proud basin
#

I just said I tested them both and they aren't

eternal oxide
#

I know you said that, but you are likely wrong

#

there can only be three possible things there that can throw an npe.

#

fr, sidebar, or you misread the npe and its thrown from the getStringWidth method

karmic grove
#

so im trying to update my plugin to 1.18 but somehow the api in project structure just dont work

#

but i have like 200 errors lol

wicked lake
#

That's not the library you're looking for anymore :)

topaz raven
#

Hey, im thinking of making a gun plugin but have a pretty important question before i start and id like your opinion about it. Do you think using raycasts or projectiles would be best and why?

karmic grove
wicked lake
#

Use Maven, or you can find the libraries in the bundler directory

eternal oxide
# karmic grove

you didn;t read the post about 1.18 you can not longer use the spigot jar as a depoendency

karmic grove
#

oh :(

#

so i have to use maven or somthing

wicked lake
#

If you need CraftBukkit then you'll need to get that set up as well

#

Maven is your best bet

karmic grove
#

i hate maven rip

eternal oxide
#

No, look in the Spigot\Spigot-API\target folder

#

of buildtools

ivory sleet
karmic grove
#

and gradle

ivory sleet
#

well, they're far more sophisticated than ant

wicked lake
regal dagger
#

How to change this icon or "Compatible FML modded server" to a V or Vanilla within the code?

karmic grove
wicked lake
#

Does Player.spigot no longer exist? Using bukkit-1.18-R0.1-SNAPSHOT-shaded as my library, along with bungeecord

#

Need to send players a ChatComponent formatted message

eternal oxide
#

Player#Spigot is there just fine

wicked lake
#

Cannot resolve method 'spigot' in 'Player'

eternal oxide
#

I just checked the shaded jar, its in there

grim ice
#

isnt it player.spigot()

eternal oxide
#

it also completes fine in my IDE

grim ice
#

elgar do u use eclipse

eternal oxide
#

yes

grim ice
#

do u think its better than intellij?>

#

just wondering

eternal oxide
#

"Better"? I've used both and prefer Eclipse. However if I was choosing an IDE for business I'd go intelij

grim ice
#

Oh, I see

wicked lake
eternal oxide
digital rain
#

heyy, so im guessing there is no method for detecting critical hits, in that case what parameters do i check to determine whether the hit is critical

quaint mantle
young knoll
#

inb4 directly depending on bootstrap jar

wicked lake
quaint mantle
#

use a proper build tool

wicked lake
#

Aight give me a minute

quaint mantle
#

Use spigot, Not bukkit

tender shard
#

am I correct that bungee first tries to load bungee.yml and if that doesnt exists, it tries to load plugin.yml?

tender shard
#

yeah ofc bukkit doesnt include spigot stuff

eternal oxide
#

I didn't even notice he was using bukkit not spigot for his import

quaint mantle
regal dagger
#

thought I'd point that out

quaint mantle
#

Oh yeah, then ... idk, might want to roll out a fork or something. But doesnt Bungee Forward SLPs to the Backend Server? (Idk, never used Bungee myself)

regal dagger
regal dagger
#

I know there is a ForgeClientHandler.java file that defines the mod list but idk how to make it say vanilla to forge clients

quaint mantle
#

Though doc on FML stuff is sparse Last Time I checked, but it should suffice - in theory

wicked lake
sullen marlin
regal dagger
#

lol

#

I have forge_support set to false

#

but the icon is still there

sullen marlin
#

Forwarding pings

#

Whatever the option is it’s obvious

lusty cipher
#

how do I send action bar messages to a player on craftbukkit?

regal dagger
#

I want it to be across the entire proxy

#

not just the one server

tender shard
regal dagger
tender shard
#

use spigot and use Player#spigot

regal dagger
sullen marlin
#

Craftbkkit is not a supported server software

regal dagger
#

craftbukkit is unusable

sullen marlin
#

It’s for development only

regal dagger
tender shard
#

somehow people still use it for whatever reason

#

and then complain when they get a NoClassDefFound when using TextComponents etc

sullen marlin
#

Buildtools hasn’t produced it for a couple years now

#

Though older versions I suppose

regal dagger
sullen marlin
#

What are you trying to do

lusty cipher
regal dagger
# sullen marlin What are you trying to do

To put it simply: Have the MOTD and player count from the proxy but ditch the FML mod loaded stuff and just make the server look as Vanilla.. I don't need or really want to take that status from the default server

sullen marlin
#

Sounds like a bug, open a bug report

lusty cipher
regal dagger
lusty cipher
#

Or why not merge CB and Spigot?

quasi patrol
#

I’m asking here cause their discord isn’t very helpful, how would I get an offline user’s plot count, and max plot count in Plot Squared, their placeholders don’t support offline players and their api docs hurt my brain cells for my plugin.

lusty cipher
sullen marlin
#

It was pretty clearly advertised as not supported years ago and buildtools requires special arguments to get it

regal dagger
sullen marlin
regal dagger
#

I mean it's just a small detail and almost every server has that tick with 0 mods present but it just gets on my nerves

lusty cipher
#

Googling Craftbukkit server yields so many sites, videos and tutorials

mighty cloud
#

good afternoon

#

there's a long-standing bug with Spigot & worldgen datapacks that I'd like to see if you guys could kill once and for all

sullen marlin
#

Did you open a bug report

mighty cloud
#

not sure if it has been reported, but I will

hushed garnet
#

👀 Okay so I have a general question about writing objects and getters/setters.

I find myself writing this same stuff over and over. Is it bad to drop the get/set methods and just make the variables public and manipulate directly? I don't really understand the difference, especially if my getters/setters are so straight forward. if there's other code happening then yes include a getter/setter, otherwise should I just skip them?

public class WorldCustom {

    String worldName = "world__rush_";
    World w;
    
    public String getWorldName() {
        return worldName;
    }
    public void setWorldName(String s) {
        worldName = s;
    }

    public World getWorld() {
        return w;
    }
    public void setWorld(World theworld) {
        w = theworld;
    }
    
}```
ivory sleet
#

No

#

You ultimately limit yourself and make your code architecture less flexible by exposing state

mighty cloud
ivory sleet
mighty cloud
# mighty cloud https://hub.spigotmc.org/jira/browse/SPIGOT-6838

wrt why this is so important: we have a lot of issues with people being able to install Terralith on Spigot servers; we end up having to instruct people to install it on a singleplayer world first and move it to the server, which is not ideal. So a fix would be really appreciated

ivory sleet
sullen marlin
mighty cloud
#

It's not reliable. We get a lot of reports that at the first server start, the dimension doesn't load properly

#

and you get regular mc overworld

#

If you delete everything again, everything is fine

sullen marlin
#

Your bug report doesn’t make sense

#

You say you have to start with a blank server

fleet badger
#

What's the difference between net.md_5.bungee.api.ChatColor and the other regular ChatColor? I've noticed that the bungee one has an of method but the other one doesnt. whats that about?

sullen marlin
#

But the. You say the way to fix it is to delete everything

#

Which would just restore you to the same blank state

mighty cloud
#

Not everything, sorry - only region folder and level.dat

sullen marlin
#

Because you deleted everything

mighty cloud
#

It is a really strange behavior

sullen marlin
#

What other files would you expect are impacting it then

mighty cloud
#

I have no idea. But I just verified on a server, and it started with incorrect dimension file.

sullen marlin
#

I really don’t believe this bug report, as I said I tested terralith last week

mighty cloud
#

Let me try it again then.

#

world-gen bug

hushed garnet
ivory sleet
#

Yeah well, it's much about keeping the code flexible for possible changes in the future

stone sinew
#

I hate that you can't just simply delete a commit on github. And then it fucks up your entire project.

sullen marlin
#

git reset --hard; git push --force

stone sinew
mighty cloud
#

ok, I think I know what might be happening with worldgen bug

gray comet
#

Watch the world burn

ivory sleet
stone sinew
#

Ok so I was able to get my target folder and it contains all the modified code that I need but I can't just put those classes in the src folder. An idea how to make target the new src?

stone sinew
ivory sleet
#

I mean revert exists

mortal geyser
#

That’s what I thought of first.

stone sinew
ivory sleet
#

I have a hard time believing it'd be git's, github's or your ide's fault. Sounds like a pebkac issue imho.

stone sinew
#

IDK I reverted and then my code got fucked up and it didn't match so I pushed the commit that was still available that was suppose to contain the changed code but it didn't, Github is just a fucking joke. I should literally just be able to click delete commit. Thats it.

ivory sleet
#

How did you even delete a commit through github?

#

Or well, where do I find it? I am going to test whether what you're saying is true or not as I got curious if you don't mind.

stone sinew
ivory sleet
stone sinew
#

Yeap

ivory sleet
#

first of all that's not github's fault then

stone sinew
#

Then with github desktop I pushed the commit that was saved

ivory sleet
#

you probably just used it on whatever upstream you got, in this case github

stone sinew
#

Which was suppose to be the new one. It wasn't

ivory sleet
#

I am pretty sure using something like bitbucket or even gitlab would provide the same result

#

but ima try that for now, altho I'm still puzzled why the heck you didn't just use revert

#

and then pushed it upstream

stone sinew
#

Cause that still commits

#

I'm trying to delete the commit not make new ones

stone sinew
ivory sleet
stone sinew
ivory sleet
#

wut

eternal night
#

Isn't the easiest way to drop a specific commit to just, rebase and drop the commit then force push ?

stone sinew
eternal night
#

what xD

#

it is pretty straight forward

stone sinew
#

Its not

noble lantern
#

Target is all compiled class files

#

If you want to revert a commit from a while ago why dont you just pull from a specific commit

#

and then update your project root with that git project, and then push

stone sinew
#

Yeah I said fuck it lol. So I reverted the commit back to the last one it was at. Then I imported the project from github and I'll just decompile and re add the classes I need to.

noble lantern
#

how did you even manage to do that lol

#

I use the desktop app as well and never has issues with it

stone sinew
eternal night
#

what exactly are you trying to do ?

#

sorry I wasn't there at the start of this

#

delete the latest x commits ?

stone sinew
#

It doesn't matter now. I got it all sorted.

eternal night
#

ah nice

stone sinew
#

Except for that damn .gitignore file still shows

late sonnet
#

add the .gitignore in .gitignore (?

eternal night
#

you want the gitignore to be tracked by git

#

that is the entire point of the file

stone sinew
eternal night
#

not having the gitignore tracked by git is simple a misuse

#

if you want to exclude files locally and only on your pc, use .git/info/exclude

stone sinew
#

The whole point of gitignore is to ignore the files you don't want on the repo

eternal night
#

Yes, but that information is supposed to be publically available so that, if anyone else is working on it they also know what files should not be committed

#

again, if you only want to exclude things locally, use the file i referenced earlier

#

it is specifically there for that usecase

stone sinew
eternal night
#

well then use the respective file I mentioned

stone sinew
#

No. I'll use the same file from my other repos.

eternal night
#

okay 👍

#

then good luck with it

#

you can delete a file from the git tracking without removing it from the fs btw

stone sinew
eternal night
#

might be what you want here

#

this is git not github

#

you are just failing at git, github has nothing to do with this

eternal night
#

I mean yea ?

#

whats the issue with committing

stone sinew
#

I don't want random commits

#

I want just update commits that's it.

eternal night
#

then fix it up into a previous commit ?

stone sinew
#

I have lol. You can see a commit that's suppose to have fixed the gitignore shit

eternal night
#

the update gitignore commit ?

#

that is not how git file tracking works my man

noble lantern
#

or just delete the file from your local project files and push...

eternal night
#

You can literally just git rm --cached .gitignore

noble lantern
#

hes using the github client iirc

stone sinew
eternal night
#

even github client must have a way to do this

noble lantern
noble lantern
#

clone the repo, when you delete gitignore it shows up in changes

stone sinew
eternal night
#

ah yes, hardcoded file paths in pom files 🙏

noble lantern
#

commit, and bam done

stone sinew
eternal night
#

you know you can set system specific variables in your ~/.m2/settings.xml

noble lantern
#

^

eternal night
#

that you can then reference in a projects pom

#

a lot cleaner

sullen marlin
eternal night
#

🙃

#

perfect

noble lantern
#

hahaha

stone sinew
# noble lantern

I'm not trying to remove the file. I need the gitignore to ignore files. But it's still posting the file on the repo even though the file includes itsself.

eternal night
#

I literally posted the command you run

#

just copy and paste it into your shell that is in your project root

stone sinew
eternal night
#

but then what is the issue xD

stone sinew
eternal night
#

good luck on your journey to defy best practices xD

noble lantern
#

I can contest with lynx that github client isnt very good at this and youll need to use the command to update the gitignore

#

i just forked the project and tried on the client, just use the git command he sent above ^

eternal night
#

don't you fork it, this project is not for contribution or usage!!

noble lantern
#

wait it says that

#

oh no xD

#

ide be happy as hell if someone forked my project LMAO i wouldnt care xD

#

oh yay

eternal night
#

👀

noble lantern
#

dependabot not knowing its shiz again

stone sinew
#

Idc if you fork it lol. It's unusable without Minions-Revamped

noble lantern
#

eh i only did it to test gitignore

hybrid spoke
#

and you get your first contributors

noble lantern
#

and having people who dont know the project language ask for help on a day to day basis...

#

on this already has 55 PR's it feels like no ones really did that much

compact crane
#

How can I spawn an entity or LivingEntity with metadata so that, for example, the type or appearance of a horse remains the same. Does anyone have an idea?

eternal night
#

You can set the type and appearance on the horse instance that is returned when you spawn it ?

compact crane
#

Yes but it should work for all entities. So horse is just an example. It should pack animals in a kind of bag

eternal night
#

huh ?

#

where would you get the apperance from then ?

#

this seems like an xy, what exactly is your goal

compact crane
eternal night
#

you'll have to dive deep into the server source for this or use paper-api, as they offer a full serialisation for entities

#

there is no API way, at least on spigot, to accomplish this (easily)

compact crane
#

ok, thank you

eternal night
#

just note that you cannot upload plugins that only run on paper to spigot

#

tho that might not be an issue if this is for a personal server

compact crane
#

Ok, this is for my private server

misty current
#

so i gave myself an head

#

and now my client crashes

#

nice

#

oh interesting, in 1.8 if you make an head without proper signature and value it commits dead

buoyant viper
#

oh yeah there was a client that let u make those heads to crash players

misty current
#

a friend of mine kept giving me heads with a skullowner of 0

#

but it just kicked me for invalid data

#

while empty signature straight up crashes my client

eternal night
misty current
noble lantern
#

just make a for every block in world and add it to a hashmap

#

slowly but surely your ram go byebye

misty current
#

na not crash server

#

crash client

#

we do some trolling

noble lantern
#

Hey client, wanna update your client for me 30 times in 5 milliseconds

misty current
#

wat

noble lantern
buoyant viper
#

just kick player

#

hey player, leave

noble lantern
#

play tnt packets to only the player until they crash

misty current
#

nah not kick them for invalid packets, crash client funnier

noble lantern
#

just endless explosions to lag theyre pc out

misty current
buoyant viper
#

slowly fill up their disc space by causing invisible exceptions

#

like bad packets with netty or something

misty current
#

the only crash i'm aware of in 1.17 involves campfires

misty current
#

2gb json

noble lantern
#

Meanwhile the server owners: Why do our players keep getting disconnected

#

make it a secret feature in a plugin

misty current
#

wait actually this might only work for lunar

#

welp

#

no secret feature

#

i mean if you want to not let people play with lunar imagine tinkering with lunar api, just place campfire

noble lantern
#

"If you do this it will disconnect the player"

#

and put it on some weird ass wiki page like a developer documentation area

misty current
#

as long as it's disconnecting it's fine, but if it crashes players well not so much

noble lantern
#

Say its a feature to save player data

#

bam

#

ez

misty current
#

mmmmmmh

#

sounds not suspicious at all

#

lol

noble lantern
#

naaaah