#help-development

1 messages · Page 1110 of 1

noble current
#

@echo basalt i need your help

primal mica
#

block.isValidTool() is random on certain items like LEAVES, I need something like this but not random, what should I use?

chrome beacon
#

What do you mean by random

#

also that method doesn't exist

#

(in Spigot)

primal mica
#

sorry, but getDrops() I think is in spigot, I just need to know if the tool is correct to break the block

#

I have a bossBar indicating if item can be dropped or not, but when I target a leave with hand it is changing every tick because getDrops() 95% returns empty

young knoll
#

Yeah that’s just how leaves work

#

You should use tags and whatnot

#

BlockData#isPrefferedTool is also an option

primal mica
drowsy helm
#

Pretty sure theres a method for whether an item can yield drops on a block either in mayerial or blovkdata

twin venture
#

Using mongodb ,-,

drowsy helm
#

Yeah there ya go

tardy delta
twin venture
#

i have mongo on docker , i don't remmber how to use it

deft locust
#
                Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();

                Objective healthObjective = scoreboard.registerNewObjective("rust_health", Criterias.HEALTH);

                healthObjective.setDisplayName("§c❤");
                healthObjective.setDisplaySlot(DisplaySlot.BELOW_NAME);```

I need to do this but give a tag if user.isBeginner() or if not give another tag, this is constantly updated. I need to add this in addition to life, how do I do it?
drowsy helm
#

How to use docker?

twin venture
#

xDD

drowsy helm
#

You can set auth in compose pretty easy

twin venture
#

i did , but it still not working ..

drowsy helm
#

Probs shouldve clarified

eternal oxide
#

ah

twin venture
#

i host it on my own server

#

using docker

drowsy helm
#

You’ve restarted the container right?

twin venture
#

no its been 3 month since i worked on my plugins so i fogot my server info (for mongo)

#

for testning yk

tardy delta
#

only 3 months

twin venture
#

i have really hard job ..

drowsy helm
#

Amateur. It’s been 10 years since ive seen my children

twin venture
#

oh ..

drowsy helm
#

Are you using docker compose?

peak depot
#
                Player targetPlayer = Bukkit.getPlayer(t);
                if(targetPlayer == null || !targetPlayer.isOnline()) {
                    player.sendMessage(main.getMessage("PlayerGottaBeOnline"));
                    return false;
                }
``` since when doesnt that work anymore?
twin venture
#

or i am i really forgot 😦

#

then how iam running pterodactyl panel ....that's pretty weird

drowsy helm
#

Docker ls

#

Not app

#

Either way mongo will have your auth in some file

#

Im pretty sure you can exec -it in and add ajother account anyway

twin venture
#

where?

drowsy helm
twin venture
#

that's the thing i forgot xD

drowsy helm
#

Lmao

#

Must not be that important of a db?

#

Make a new one

twin venture
#

yes

#

the thing is i can't access mongodb ..

drowsy helm
#

Yeah like a whole new docker container

#

Just start from scratch

twin venture
#

ok , can you help me setup it ?

blazing ocean
#

just use compose like a normal person

twin venture
#

do i need to remove mongodb?

drowsy helm
#

Id really recommend you use docker compose

twin venture
#

i don't have anything important in the database anyway

drowsy helm
#

Thats if you dont want to install it through docker

#

If you want a docker container for mongo dont worry anout downloading mongo

#

Install docker compose and I’ll show you from there

quaint mantle
#

why was getOfflinePlayer(String) deprecated?

blazing ocean
quaint mantle
#

huh

blazing ocean
#

oh wait

#

it's not deprecated on paper kek

blazing ocean
quaint mantle
#

what does that mean

eternal oxide
#

Players can change their name once every 30 days, so using names to fetch an account is unreliable

quaint mantle
#

ahhh okay

eternal oxide
#

the dep is simply a warning to be certain what you are doing when using the method

quaint mantle
#

will the blocking of the web request be that impactful?

eternal oxide
#

it can

quaint mantle
#

how does one get around that

eternal oxide
#

generally you'd never notice, but it is a web request so could be delayed

#

if it is delayed you'd lock the server for a few ms

quaint mantle
#

can this method be run in async?

eternal oxide
#

You can, but its not really safe

quaint mantle
#

what are the alternatives to not have the lock the server

eternal oxide
#

noit using teh name version use UUID

#

I don;t remember if the UUID version does a lookup

slender elbow
#

it doesn't

elfin atlas
#

Does someone has a idea why this doesn't load any texture to a head on older mc versions it totally worked fine

fun build(): ItemStack {


        val head = ItemStack(Material.PLAYER_HEAD, 1, 3.toShort())
        if (base64!!.isEmpty()) return head


        val headMeta = head.itemMeta as SkullMeta
        val profile = GameProfile(UUID.randomUUID(), "head")
        val encodedData: ByteArray = Base64.encodeBase64(java.lang.String.format("{textures:{SKIN:{url:\"%s\"}}}", base64).toByteArray())
        profile.properties.put("textures", Property("textures", String(encodedData)))
        var profileField: Field? = null
        try {
            profileField = headMeta.javaClass.getDeclaredField("profile")
            profileField.isAccessible = true
            profileField[headMeta] = profile
        } catch (e1: NoSuchFieldException) {
            e1.printStackTrace()
        } catch (e1: IllegalArgumentException) {
            e1.printStackTrace()
        } catch (e1: IllegalAccessException) {
            e1.printStackTrace()
        }
        if (this.displayName!=null) {
            headMeta.setDisplayName(this.displayName);
        }

        if (this.lore!=null) {
            headMeta.setLore(this.lore);
        }

        head.setItemMeta(headMeta)
        return head
    }
peak depot
#

1.8 moment?

young knoll
#

Use the api

elfin atlas
ebon hawk
#

I want my plugin to send an update message when a new version of my plugin is released

#
String updateURL = "https://www.spigotmc.org/resources/exstraban-%E2%9C%A8-plugin.119078/history";```
#

How do I put the new update link in the plugin?

ebon hawk
opaque cove
#

Hi im pretty new to coding and I need help with my Plugin. Yes I know there are Plugins like this already but i wanna write it by myself. I wanna create a Multiworld Plugin with a Lobby, a Creative World and a Survival World. Everytime u reconnect u get tped to the Lobby and need to get through a portal or smt to get back to the world where u played before. My problem is that the server isnt loading the Lobby world so i need help getting it loaded 😄 And yep I know my english is not the very best cause I'm from germany

#

package de.stauder.test.listener;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;

public class ConnectionListener implements Listener {

@EventHandler
public void onJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    event.setJoinMessage(ChatColor.DARK_PURPLE + player.getName() + ChatColor.GRAY + " hat das Spiel betreten");
    
}

@EventHandler
public void onLeft(PlayerQuitEvent event) {
    Player player = event.getPlayer();
    event.setQuitMessage(ChatColor.DARK_PURPLE + player.getName() + ChatColor.GRAY + " hat das Spiel verlassen");

}

}

Thats my code for the listener. I tried some player.teleport(Bukkit.getServer().getWorlds().get(0).getSpawnLocation()); but everything i tried didnt work cause the world is not loaded

#

for 1.21.1 Paper

chrome beacon
#

What you want to make is a bad idea. You should not be mixing multiple gamemodes on one server

#

Instead use a multi server setup with a proxy like Bungeecord

opaque cove
#

Im a starting programmer 😄 I dont know anything how to setup a multiserver etc

eternal oxide
#

get(0) is the main world

#

its always loaded

#

however, do not try to teleport IN the join event

opaque cove
#

yeah i wrote a lot of world names in it but it will never work cause the world world_lobby isnt loaded

eternal oxide
#

delay the teleport by a couple of ticks

opaque cove
#

how do i delay it?

eternal oxide
#

?scheduling

undone axleBOT
opaque cove
#

and how can i load worlds with a plugin?

eternal oxide
#

worldCreator

opaque cove
#

i dont need to create worlds. i need to load it

eternal oxide
#

it tries to load the world first, then creates it if it does not exist

#

ie WorldCreator("YourWorld").createWorld()

opaque cove
#

well it doesnt work ._.

eternal oxide
#

then you did it wrong

opaque cove
#

for me it seems like an another instance of minecraft running but how do i connect them?

opaque cove
# eternal oxide then you did it wrong

@EventHandler
public void onJoin(PlayerJoinEvent event, Plugin plugin) {

    Player player = event.getPlayer();

    event.setJoinMessage(ChatColor.DARK_PURPLE + player.getName() + ChatColor.GRAY + " hat das Spiel betreten");
    new WorldCreator("world_lobby").createWorld();

    BukkitScheduler scheduler = Bukkit.getScheduler();
    scheduler.runTaskLater(plugin, () -> {
        Bukkit.broadcastMessage("Loading!");
    }, 20L * 30L /*<-- the delay */);

    player.teleport(Bukkit.getWorld("world_lobby").getSpawnLocation());
}
eternal oxide
#

yeah you did it wrong

#

your teleport is not in the task

opaque cove
#

how do i add it to it then?

twin venture
#

Anyone used Morphia before with mongodb?

ripe badge
#

Hi! I need help creating a plugin that makes it so when a world is generated, the center of the world (0,0) is a roofed forest. Alternatively, using a command, it could create a roofed forest with a radius of XX. I've been trying for 6 hours and the results haven't been successful, so it would be great to get a bit of help ^^'

chrome beacon
#

?jira Make a bug report

undone axleBOT
nova shoal
#

Dear,

I got a problem with my Discord plugin where this import is not recognized : import net.dv8tion.jda.api.entities.TextChannel;

#

My dependency is well declared into my pom: <dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0</version>
</dependency>

humble tulip
#

send your entire pom

#

?paste it here

undone axleBOT
quaint mantle
#

Small question about NMS. I have this zombie entity class, in where I have

@Override
public void die(DamageSource damagesource) {
    super.die(damagesource);
}

How would I know if the entity died because of sun burn?

#

I don't really care if its sun burn (as I guess it's impossible to know), but any kind of fire damage

river oracle
#

Use damage source

#

If you're using nms use a little initiative

quaint mantle
#

I know, but I found two, in fire

#

And on fire

river oracle
#

There you go

quaint mantle
#

Which one of them is the correct one?

#

And why are there two?

river oracle
#

You know what the difference between in and in are

wraith delta
#
    @EventHandler
    public void onEntityDamage(EntityDamageEvent event) {
        Entity entity = event.getEntity();
        if (entity.hasMetadata("custom_entity")) {
            event.setCancelled(true);
        }
    }
```Howcome this does not prevent me from killing my entity with a sword? is there a different type of event to check for hitting?
river oracle
#

In meaning inside on meaning on the entity

wicked sinew
#

That’s my guess

acoustic shuttle
#
                                NBT.modify(item, nbt -> {
                                    ReadWriteNBT profileNbt = nbt.getOrCreateCompound("minecraft:profile");
                                    ReadWriteNBT propertiesNbt = profileNbt.getCompoundList("properties").addCompound();
                                    propertiesNbt.setString("name", "textures");
                                    propertiesNbt.setString("value", customHeadUUID);
                                    profileNbt.setUUID("id", finalTextureUUID);
                                });```
Anyone got any idea why this is being put under the "minecraft:custom_data" tag?
(mc version 1.21.1)
(nbt-item-api)
umbral flint
#

Should I be using the jdbi api instead of raw Statements

slender elbow
acoustic shuttle
restive mango
#

Anyone know how you create custom recipes with outputs dependent on the input items? For example, how do you make ONE recipe which takes leather pants, and then ANY dye, and then outputs leather pants dyed that color?

drowsy helm
restive mango
#

i mean

#

i dont think mojang coded a separate shapeless for all like 150000 possible dye combinations

#

there has to be a way

drowsy helm
#

You can listen to the recipe prepare event

#

But it can be glitchy if not done right

acoustic shuttle
drowsy helm
#

What exactly are you trying to achieve. Bit of an xy problem?

restive mango
#

nah

#

it's not xy

umbral flint
#

I actually helped Mojang with all the dyes

drowsy helm
#

It is

restive mango
#

i have a set of basically thousands and thousands of dyes

slender elbow
restive mango
#

im not coding a shapeless for every single one 😛

drowsy helm
#

But yeah, you can do a shapeless for each dye then calculate the dye colour in recipe prepare event

restive mango
#

this is th ekey imo

drowsy helm
#

Didnt event know that was a thing

#

There ya go

restive mango
#

just dunno how it works

acoustic shuttle
drowsy helm
#

Might be internal only?

#

You could try and spoof a crafting recipr with leather armour then apply it

slender elbow
restive mango
#

well if anyone figures it out

#

lmk

true oak
#

Hi guys,
In a java plugin (spigot/paper) I would like to use a model made using bdengine (and including an animation).
I would have to summon (and then animate) the same model multiple times.
Since it's the first time I'm playing with block display / entity display and bdengine could you please give me some leads/advices on how to do this ?
Are there any pitfalls to avoid ? Do you have a link to some tutorials ? Should I use a lib/plugin to simplify this ? bdengine exports animated models as datapacks, should I use it or is there another better way (like exporting it as model and then rotate it using Entity::teleport ?
Thank you per advance !

quaint mantle
#

Is there a list of block states/properties somewhere

drowsy helm
#

Making your own is pretty complicated

#

Or do you explicitly want to make your own?

summer scroll
torn shuttle
#

Yes

summer scroll
#

pretty cool!

drowsy helm
quaint mantle
#

“Nuh uh”

wraith delta
#
    @EventHandler
    public void onEntityDamage(EntityDamageEvent event) {
        Entity entity = event.getEntity();
        if (entity.hasMetadata("custom_entity")) {
            Bukkit.broadcastMessage("hit");
            event.setCancelled(true);
        }
    }
```Howcome this code does not prevent the entity from being killed/hit even tho the log happens
drowsy helm
wraith delta
#

this debug log ran, it should have cancelled the event

drowsy helm
#

Try highest priority

wraith delta
hybrid turret
#

there are so many cool things in the spigot subclass for the Player but they're all "Not supported yet" 😭
Why yall teasing me? 😭

ripe badge
#

Hi! I need help creating a plugin that makes it so when a world is generated, the center of the world (0,0) is a roofed forest. Alternatively, using a command, it could create a roofed forest with a radius of XX. I've been trying for 6 hours and the results haven't been successful, so it would be great to get a bit of help ^^'

merry sapphire
#

#general message

blazing ocean
#

don't crosspost @merry sapphire

merry sapphire
#

I need answers fast

blazing ocean
#

calm down buddy

blazing ocean
merry sapphire
#

sorry, im so hyped rn

merry sapphire
worthy yarrow
blazing ocean
#

timezones

pseudo hazel
#

idc what time it is, you dont cross post in every channel

worthy yarrow
#

Steaf know any bed time stories?

pseudo hazel
#

you use the channel thats most applicable for your question

#

no

#

go to bed.

worthy yarrow
#

Man you and rad suck

blazing ocean
#

no u

pseudo hazel
#

your mind will make up stories

#

thats y u have s brain

worthy yarrow
#

I don’t remember dreaming, not for a couple years at least lol

merry sapphire
worthy yarrow
#

Ooooo?

pseudo hazel
#

dude im just telling you to be a little bit reasonable

#

i dont go around in servers spamming every channel

#

if someone knows the answer and wanna help, they will answer you

merry sapphire
blazing ocean
#

just use the correct channels.

merry sapphire
blazing ocean
#

you started by crossposting in EVERY single channel

#

lol

pseudo hazel
#

that was to rad

merry sapphire
pseudo hazel
#

rad started about the time

#

which is irrelevant

merry sapphire
blazing ocean
#

i mean

#

people are at work or something

pseudo hazel
#

I mean

#

there are like a billion timezones

worthy yarrow
#

@merry sapphire

merry sapphire
worthy yarrow
#

I literally chat gpt it mane

merry sapphire
#

I dont use that LOL

pseudo hazel
#

your loss

#

okay ill go now

worthy yarrow
#

gpt is a nice search engine

hybrid turret
#

can someone tell me what CustomModelData is? (ItemStacks)

pseudo hazel
#

its mainly for resource packs to assign custom models to an item

#

the resource pack can change the texture or model depending on what number you use

hybrid turret
#

ahhhhhhhhhhhhhhhhhh

#

so you would use it with a custom resource pack that you could give out bundled with your plugin or sum?

#

i suppose that's what ItemStack#setCustomModelData is for?

pseudo hazel
#

yes sure

#

yup

hybrid turret
#

thanks

peak tendon
#

anyone know how to get a 20 bytes long sha1 hash for setresourcepack

#

cant find the java jacksblibraray that is recommended in some help articles

blazing ocean
hybrid turret
# peak tendon anyone know how to get a 20 bytes long sha1 hash for setresourcepack

ngl i tried chatgpt for this one:

public class ResourcePackHashGenerator {

    public static String generateSHA1Hash(String filePath) throws Exception {
        // Load the file
        Path path = Paths.get(filePath);
        byte[] data = Files.readAllBytes(path);

        // Get SHA-1 digest
        MessageDigest digest = MessageDigest.getInstance("SHA-1");
        byte[] hashBytes = digest.digest(data);

        // Convert to hex string
        StringBuilder sb = new StringBuilder();
        for (byte b : hashBytes) {
            sb.append(String.format("%02x", b));
        }

        return sb.toString();
    }
}
#

and from what i know it makes sense

#

then u need the URL of ur resource pack and its hash and set the pack

#

if the player doesnt have it yet: he will download it, if not: it will automatically load it via the hash

pseudo hazel
#

i used a site

#

I think I used the guide on the adventure wiki

slate rose
#

Thank you @hybrid turret @blazing ocean

pseudo hazel
#

that led me to convert the string to a hash in website

peak tendon
#

really appreciate the help thank you ❤️ 💚 💙 🤟

hybrid turret
#

np :)

#

Why is ItemStack#setDurability deprecated? 🤔

blazing ocean
#

durability is now part of ItemMeta. To avoid confusion and misuse, getItemMeta(), setItemMeta(ItemMeta) and Damageable.setDamage(int) should be used instead. This is because any call to this method will be overwritten by subsequent setting of ItemMeta which was created before this call.

hybrid turret
#

oh nvm

#

i just saw it

#

thanks tho rad

#

i was blind apparently

#

sets the damage

#

Does this mean it sets how much durability is removed or how much is left?

peak depot
#

?tas

undone axleBOT
hybrid turret
#

tbh

#

fair enough

#

i asked bc i don't have the resources (or balls) to try it rn since i'm at work lmao

#

buuuuuuuuuuuut since ItemStack#setDurability just passes the value to Damageable#setDamage, ig it's the durability

pseudo hazel
#

damage means how much durability is taken away

#

full durability is 0 damage

#

you should use damageable and use setmaxdamage and setdamage

hybrid turret
#

oh so it is inverted from what it was before okay

#

thanks

#

to whoever gave me the idea with the ItemBuilder, i love you dude. idk why i didnt think of this earlier, lol

hybrid turret
#

How do I use the Colorable interface?

pseudo hazel
#

what is it

#

from ItemMeta?

ocean hollow
#

when I use ItemDisplay#setRotation does setТeleportationDuration work for him?

peak depot
#

whats the best way to store changeable messages like what file type

hybrid turret
#

or do i just setDamage with the Color.getData()

#

or in other words: how do i set a dye color? i can only find old shit in the forum

smoky anchor
ocean hollow
#

I prefer to change the actual rotation for parts rather than LeftRotation

#

like here

#

this is so that you don't have to bother with converting back and forth from EulerAngle to Quaternionf

hybrid turret
#

@sterile breach u wanted to send me ur code for ur PaginatedGUI/Menu approach, just a reminder (i would have forgotten, if i didnt note it down)

pseudo hazel
#

but it mostly applies to blocks like beds

#

and stuff you can color by clicking on it

#

like signs

hybrid turret
#

items.

soooo i guess beds, wool and dye?

pseudo hazel
#

yeah not for items

hybrid turret
#

okay so Colorable is for blocks

#

and i just set damage for items?

smoky anchor
pseudo hazel
#

yes and entities like sheep and shulker

hybrid turret
#

ahh

pseudo hazel
#

but like why do you need it

hybrid turret
#

ItemBuilder

pseudo hazel
#

wdym

hybrid turret
#

but this uses a lot of deprecated stuff

#

and i want to do it proper

pseudo hazel
#

dont add methods you aint gonna use

#

just expand it as needed

#

unless you wanna release it as an API

#

in which case there are like a billion already probably

#

and is hard to do properly for all cases

hybrid turret
#

i basically do all of my project without extra stuff

#

bc it's my learning project

pseudo hazel
#

right

hybrid turret
pseudo hazel
#

then just create the methods when you need them

#

not preemptively

hybrid turret
hybrid turret
pseudo hazel
#

well its like the exact opposite

hybrid turret
#

for me it isn't

pseudo hazel
#

why make a bloated class you will only use 10% of

#

thats called wasted effort

hybrid turret
#

i waste all my effort in this plugin xd

#

bc i just want to implement stuff

pseudo hazel
#

atleast waste it to actually improve the plugin

#

but its your decision i guess

hybrid turret
#

it's less about functionality

#

more about just doing stuff

#

sooo again, what would be the today way of setting item colors?

pseudo hazel
#

idk

#

apart from what I did I have not found a nice api to use

#

but essentially, manually

hybrid turret
#

hmmm alright guess i'll go through the docs again, ty anyway :))

pseudo hazel
#

if you find a better way, please lmk xD

hybrid turret
#

i will lol

urban escarp
#

hello

#

It should return true or false smth..but it returns string false i really got no idea why

#
]: Error occurred while enabling NarniaCore v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "lt.narniacore.play.MainClass.getCommand(String)" is null

#

    @Override
    public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
        Player player = (Player) sender;
        if (command.getName().equalsIgnoreCase("upick")) {
            if (args.length != 1) {
                player.sendMessage("§8(§c!§8)§7/upick §8<unbreaking/fortune/efficiency>");
                return true;
            }
            if (!player.getInventory().getItemInMainHand().getType().equals(Material.DIAMOND_PICKAXE)) {
                player.sendMessage("§8(§c!§8)§7Norint tobulinti įrankį, tau reikia jį laikyti rankoje!");
                return true;
            }

            ItemStack pickaxe = player.getInventory().getItemInMainHand();

            if (args[0].equalsIgnoreCase("unbreaking")) {
                if (getBlocks(MainClass.instance, pickaxe) >= 100) {
                    player.sendMessage("" + getBlocks(MainClass.instance, pickaxe));
                    ItemStack newPickaxe = registerUpgrade(MainClass.instance, pickaxe, player, 100);
                    ;
                    player.getInventory().setItemInMainHand(newPickaxe);
                    return true;
                }
                return true;
            }
            if (args[0].equalsIgnoreCase("fortune")) {
                player.sendMessage("fort");
                return true;
            }
            if (args[0].equalsIgnoreCase("efficiency")) {
                player.sendMessage("eff");
                return true;
            } else {
                player.sendMessage("§8(§c!§8)§7/upick §8<unbreaking/fortune/efficiency>");
                return true;
            }
        }
        return true;
    }```
chrome beacon
urban escarp
#

well

#

the thing it used to work

#

I'll double check

#

yeah it's not. But it's some intelliji problem. It keeps making it to old version

#

thank u

peak depot
#

is there a way to check if player has permissions on AsyncPlayerPreLoginEvent

eternal oxide
#

there is no player at the pre login event

peak depot
#

thats what I was thinking

#

thanks

blazing ocean
#

i mean if you use luckperms you can use their api ig

peak depot
#

yeah I know but pure spigot

floral drum
#

All you use should really be the UUID provided in the event, using a permission plugin’s api.

#

Checking that way

eternal oxide
#

you still can;t get accurate perms as they may differ by world

peak depot
#

yeah im just gonna go to user Join Event then

eternal oxide
#

much safer

wet breach
#

use OfflinePlayer to check

peak depot
#

Nah it’s on temp servers so mostlikey not played before

wet breach
peak depot
wet breach
#

OfflinePlayer has permissible

#

so just do OfflinePlayer.hasPermission()

peak depot
#

But will that work if I eg. have luckperms running(syncing with db) and using cloud system I create a minigame server fresh, no data, will Offlineplayer perms check still work there?

alpine urchin
#

@wet breach im gonna live in us

#

hold me to it

#

in the future

alpine urchin
#

GOD BLESSS AMERICA

#

@wet breach say it with me

slender elbow
lone oracle
#

can some1 please explain what I'm doing wrong here?:

Bukkit.getScheduler().runTaskLater(this, new Runnable() {
              @Override
              public void run() {
                // code
              }
        }, 100);```
The error cones under `runTaskLater` and says `The method runTaskLater(Plugin, Runnable, long) in the type BukkitScheduler is not applicable for the arguments (CmdStart, new Runnable(){}, int)`
Thaks :P
summer scroll
lone oracle
#

still giving the same error :/

slender elbow
#

whatever this/CmdStart is, it is not a Plugin instance

lone oracle
#

idk if im missing something esomewhere else

slender elbow
#

you need to pass your Plugin instance to the scheduler

summer scroll
#

Oh yeah, the this must be a plugin instance.

lone oracle
peak depot
onyx fjord
#

how would i go about implementing serializing and deserializing objects from and to database (and ideally using a single table for all implementations of the object)

#

like, should i serialize with gson and then save to db as string?

#

or in different way

summer scroll
#

probably, that's what i would do.

hybrid turret
#

also what do you mean by "using a single table for all implementations fo the obkect"?

onyx fjord
#

different implementations of an interface

#

to store different things

wet breach
onyx fjord
#

whichever would be the best

wet breach
#

in mysql, there is blob = binary large object

hybrid turret
# hybrid turret also what do you mean by "using a single table for all implementations fo the ob...

bc this sounds like it violates https://en.wikipedia.org/wiki/Third_normal_form

Third normal form (3NF) is a database schema design approach for relational databases which uses normalizing principles to reduce the duplication of data, avoid data anomalies, ensure referential integrity, and simplify data management. It was defined in 1971 by Edgar F. Codd, an English computer scientist who invented the relational model for d...

onyx fjord
#

i have an inteface Mail with implementations like ItemMail or CommandMail to store either string command or itemstack item

#

and i wanna load it to memory only when player is online

hybrid turret
onyx fjord
#

it has a method to get the stored value from it

#

which could be anything depending on the implementation

wet breach
onyx fjord
#

and a method which returns nothing and executes something to give player the thing stored in mail

wet breach
#

if I was using mysql

#

you could technically serialize as a java object instead and store it as blob as well, which you don't need to really implement much for that except serializable

hybrid turret
onyx fjord
#

not exactly, its given to the player by server

#

when player is offline

#

to collect later

#

for example you cant give player an item if offline

hybrid turret
#

like... a reward from an automated system or sum?

wet breach
#

I would store the mail content however as a blob though

hybrid turret
#

i see

wet breach
#

so as to preseve any encodings

#

or weird characters etc

hybrid turret
#

i mean is there much of a difference between a b64 string and a blob?

wet breach
#

yes

#

base64 is still a string

#

a blob is the literal binary representation of it

hybrid turret
#

yeah but isn't it just bytes represented as string?

wet breach
#

not really

#

its just changing the format of the data or its representation

#

blob is just binary

hybrid turret
#

well tbh not much discussion since blobs are also a lot faster, no?

onyx fjord
#

i could maybe make the interface force implementations to implement a method that returns arr of bytes

umbral ridge
wet breach
#

they can be yes, but the down side is they can't be optimized and sometimes take up more space since mysql can't compress it

umbral ridge
#

Ho frosted elf

#

Hi

hybrid turret
umbral ridge
#

NoSQL the best

onyx fjord
#

umbral ridge
#

😂

hybrid turret
#

we won't fight sql wars here now

wet breach
onyx fjord
#

not universal

hybrid turret
#

please xd

onyx fjord
#

it must be plug&play so sqlite

umbral ridge
#

xdxddddxd

wet breach
#

sqlite doesn't have blob

onyx fjord
#

it does

hybrid turret
hybrid turret
onyx fjord
#

im using blob with sqlite in my other plugin

chrome beacon
hybrid turret
#

best research

wet breach
#

If you are using sqlite, I would just store a reference to the text file

onyx fjord
#

no drawback of decoding

#

what text file

umbral ridge
#

The advantage of whiskey is

#

sleeping

hybrid turret
#

what

wet breach
onyx fjord
#

💀 there could be possibly hundreds of thousands of mail files then

wet breach
#

yes that is how email works

#

and it works just fine

onyx fjord
#

im not implementing email man

#

more like post office boxes

hybrid turret
#

i was just gonna say lol

#

sending packages like amazon

onyx fjord
#

exactly

stuck oar
#

does anyone know any 1.8.9 factions plugins that calculate spawner value

wet breach
onyx fjord
#

and the plugin is your virtual post office where your box is

hybrid turret
#

1.8.9 o.o

onyx fjord
#

i did say it

#

when i described the two implementations i was thinking of

#

items and commands

wet breach
#

but I do remember this discussion though

#

didn't we discuss this like a month or so ago

hybrid turret
onyx fjord
#

im positive we didnt

wet breach
#

I am pretty sure we did

onyx fjord
#

because ive created the project a week ago

#

mustve been sometihng else then

#
  • i didnt ask questions related to it here
hybrid turret
#

maybe other person, but that's besides the point.
but yeah ig blobs would be the way to go

#

wait did we settel yet what db u are using?

#

mysql?

stuck oar
wet breach
hybrid turret
#

oh

wet breach
#

they want it to work without user having to do anything else

hybrid turret
#

okay

hybrid turret
wet breach
#

the only downside with using sqlite is no cross server mailing

hybrid turret
#

well don't need that if your plugin doesn't support cross-server

#

lol

wet breach
#

sure, but something some users may actually want lol

hybrid turret
#

back in my days there was only one server 👴

onyx fjord
#

sqlite for now*

hybrid turret
#

i mean u could eventually release 2 versions. simple and advanced

#

one with sqlite and one with mysql

#

or whatever db server you want to use

onyx fjord
#

i can just abstract my databases

lost matrix
#

I see Sqlite just as a fallback in case the user doesnt have a proper SQL database.
Makes it easier because you only need to implement the persistence once.

hybrid turret
#

that's actually a cool idea

#

just have both

onyx fjord
#

dang i need to learn javas serialization now

hybrid turret
#

also hello mr bratwurst

wet breach
#

since a post box could contain quite a bit, I would probably go with blob

#

however I wouldn't use sqlite at all though for this

onyx fjord
#

yea item could be over 1kb sometimes

#

with a lot of nbt

hybrid turret
#

one singular item? damn

wet breach
#

since these boxes are going to be what no more then 100kb or whatever

onyx fjord
#

do you guys have some resource where i can learn javas serialization

wet breach
#

I would serialize to NBT into binary file with a simple storage format to easily separate the data and then dedicate like 30mb of memory to memory map files.

#

you should easily be able to load and save thousands of post boxes this way

#

this also makes it easier to implement error detection code and error correction code

onyx fjord
#

or alternatively, as you said

#

i could make json for each player

#

and only load to memory on join

umbral ridge
#

To memory

#

😂

onyx fjord
#

?

#

from json file to ram

#

essx appears to do it

wet breach
#

well my method will allow you to offload objects from memory if a box isn't being used at the moment while keeping the file in memory to re-setup the objects

onyx fjord
#

but the json approach wouldnt work with cross server synchro

#

dang

wet breach
#

it does if you make it a bungee plugin

#

or create a bungee addon for it

umbral ridge
#

how do you load a file in ram

drowsy helm
#

Read it

umbral ridge
#

isnt file in ram when you're reading it because you are reading it from the hard drive

#

ye

onyx fjord
#

onyx fjord
#

like in a map or list

drowsy helm
#

Any data that is stored in a variable, is stored in ram

wet breach
#

when you read from a file, it has to read the bytes in first. When you memory map a binary file, it just gets lobbed into ram in its entirety

onyx fjord
#

your config.yml is loaded to ram on startup for example

#

and only loaded again with reload or saved with save

wet breach
#

so a slight difference from reading a file on hard disk and memory mapping a file and then reading it

vocal cloud
#

small question how do you check what block is on a block?
like what block is on spruce_log and if its air place a item frame on it (every spruce_log)

tall dragon
vocal cloud
#

yea but like on all so also if its generated by world

tall dragon
#

do diamond blocks even generate

vocal cloud
#

o your right

tall dragon
#

only in woodland mansions iirc

vocal cloud
#

but i mean as example

tall dragon
#

well thats pretty difficult to do

lost matrix
#

Im sensing a lag machine

tall dragon
#

u would prolly have to meddle with the world generator

vocal cloud
tall dragon
#

or make a lag machine xd

vocal cloud
#

lol

tall dragon
#

well im not smart enough to help you with custom world generation sorry

vocal cloud
#

o but isend it both on player place and world generation? is that the same?

eternal oxide
#

simplest would be to scan the chunk on load if its a new chunk

#

else in teh chun generator

lost matrix
#

What are you trying to achieve in the first place?

vocal cloud
#

ummm place a itemframe on configedblock1

lost matrix
#

What for?

vocal cloud
#

minecraft plugin

tall dragon
#

😂

vocal cloud
#

lol

eternal oxide
#

lol keep going smile, he may tell you after 20 questions

river oracle
vocal cloud
#

no lol

river oracle
#

no need to thank me later

#

I am a psychic

eternal oxide
#

People tried to help but you give near to zero information

vocal cloud
#

the rest of the plugin is not inportand

eternal oxide
#

yes it is, which is why people asked for information

vocal cloud
#

i just need to know how to scan blocks

river oracle
#

what if now this is wild absolutely wild, what if there is a better way to do what you want to do

vocal cloud
#

then i will discover it later

eternal oxide
#

how to scan blocks? Block#getRelative(BlockFace.UP)

river oracle
#

I wouldn't do that thousands of tens of thousands of time on the main thread

#

terrible idea

vocal cloud
#

just on start and player place?

river oracle
#

If you want to scan blocks make chunk snapshots on the main thread using work distribution and then process them asynchronously. You need to resync to the main thread to actually do things at that location. The scanning itself though outside of making the ChunkSnapshot can be done on many threads simultaneously. This should boost the actual time it takes to scan thousands of chunks. It'll still take a while, but improve performance a ton.

lost matrix
#

I got another one

for(int x = Integer.MIN_VALUE; x <= Integer.MAX_VALUE; x++) { ... you get the idea
shadow night
#

interesting

slender elbow
#

i love the <= part

lost matrix
shadow night
#

use longs next time

lost matrix
slender elbow
#

surely it won't loop :4head:

blazing ocean
river oracle
#

so you are making a lag machine

vocal cloud
river oracle
#

stop lying!

shadow night
blazing ocean
shadow night
vocal cloud
#

? not a lag machine XD will problebly lag tho but no

lost matrix
vocal cloud
#

why?

river oracle
# lost matrix Not going to happen

you can do it.
ChunkLoadEvent,
BlockPlaceEvent,
BlockBreakEvent.

Asynchronous processing in ChunkLoadEvent after grabbing a snapshot. It'll kill the servers performance, but it does as they want

vocal cloud
#

thanks

shadow night
#

lmao

#

huh, what's thi... disintegrates in lags

lost matrix
river oracle
#

I'm assuming this is malicious

river oracle
#

only to find out it literally brings the server to its knees

vocal cloud
#

is there a better way? i mean like in a 100 block radius of a player?

slender elbow
tall dragon
#

LOL

vocal cloud
#

i just starded java let me find out how stopid i am by my self

river oracle
#

oh if you just started java go at it

#

hopefully you learn your lesson after committing hundreds of hours to this

#

do as I said it'll work perfectly

#

well the server won't like it kekw

#

but clearly you give 0 fucks about that

lost matrix
river oracle
shadow night
#

once again

vocal cloud
#

no its rily simple just place item frames on spruce_logs . nothing more

river oracle
# vocal cloud no its rily simple just place item frames on spruce_logs **.** nothing more

I genuinely want you to implement this and learn your lesson. Here are my suggestions

If you want to scan blocks make chunk snapshots on the main thread using work distribution and then process them asynchronously. You need to resync to the main thread to actually do things at that location. The scanning itself though outside of making the ChunkSnapshot can be done on many threads simultaneously. This should boost the actual time it takes to scan thousands of chunks. It'll still take a while, but improve performance a ton.

ChunkLoadEvent,
BlockPlaceEvent,
BlockBreakEvent.

lost matrix
#

In that case do what Y2K suggested. Check BlockPlaceEvents and create a Snapshot in the CunkLoadEvent to scan it async.

river oracle
#

now go do it

vocal cloud
#

yea thanks :)

river oracle
#

remember you need to resync to spawn entities and place blocks 👍

#

Bukkit scheduler

#

Bukkit.getScheduler().runTask()

#

it'll queue your sync operation for the next tick

#

though in the case where your dealing with on mass smile has a good thread on work distribution

#

?workdistro

river oracle
#

you can make your work distro queue thread safe instead of using an array deque

#

and queue to your distro setup asynchronously

#

depends on the situation idk if there are more Deque implementations

#

many data structures have different thread safe implementations

#

for different cases

dawn flower
#

https://paste.md-5.net/afodivomah.php

for some reason, this only prints one parent above, and doesn't get the root. the root should be the first parent which starts the whole recursive call and should all match

[17:45:03 INFO]: missing.plugins.turboenchants.syntax.sections.ConditionalSection@1add20cb
[17:45:03 INFO]: missing.plugins.turboenchants.syntax.sections.ConditionalSection@1add20cb
[17:45:03 INFO]: missing.plugins.turboenchants.syntax.sections.iterables.ForSection@5e2ab59d```
instead these are the "roots" it found

also the actual root is a FunctionSection
#

i think the issue is with getParents

#

it gets the root as the last child of the actual root

true oak
# drowsy helm Or do you explicitly want to make your own?

No I don't mind using freeminecraftmodels.

  • It does work with bdengine models or should I (re)create the model using blockbench ?
  • I don't want to use resource packs. Does it loads models as entity/block display (instead of client side entities using resource packs) ?
nova quail
#

Hello! How can I load the chunk for my falling block. I have made a plugin with airdrop which spawn on a random location falling block. But if the chunk isn't loaded it bugs and don't work. How can I load the chunk when my fallingblock spawns?
my startdrop method: https://paste.md-5.net/gunubuviri.cs
Can provide full code if you need.

#

I tried it with location.getWorld().getChunkAt().load(true); but it don't work

smoky anchor
#

Chunk plugin tickets probably.

merry sapphire
#

I need help setting up mmocore, mmoitems and mythic mobs to have classes with upgradable skills with skill points. The tricky part I am dealing with is that I cannot figure out how to attach an MMOcore skill to an MMOItem item. It seems that the MMOitem is basing its stats off the default skill damage values rather than the value of my skill points level. If you are deeply familiar with these three plugins please

vast ledge
#

Your maven/Gradle doesn't have spigot as a dependency

#

Checkt hat ur pom.xml or build.gradle has the spigot dependency

dry badge
#

Spigot 1.21.1

vast ledge
#

Is your main class detecting it?

dry badge
#

I'm kinda new to plugins

vast ledge
#

Can't rn, I'm on the road, kinda difficult sorry.-.

dry badge
#

Oh ok, stay safe bro

#

Can you tell me how can i find the pom.xml ?
that's the project's folder

chrome beacon
autumn ingot
#

hey y'all im having issues with Entity#copy, its just not working even though (i think) im using the method correctly

for (Entity entity : entitiesMap.keySet()) {
            try {
                entity.copy(entitiesMap.get(entity));
                Snapshots2.getInstance().getLogger().info("Copying entity: " + entity);
            } catch (IllegalArgumentException e) {
                Snapshots2.getInstance().getLogger().info("Couldn't copy entity: " + entity + " to " + entitiesMap.get(entity));
            }
        }
[16:33:20 INFO]: advaits issued server command: /rollback
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftBat to Location{world=CraftWorld{name=world},x=291.833160281426,y=1.553220565947573,z=194.6250547816754,pitch=0.0,yaw=328.55582}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftRabbit{RabbitType=WHITE} to Location{world=CraftWorld{name=world},x=270.22702206520245,y=68.0,z=195.27166055508525,pitch=0.0,yaw=309.91156}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftSquid to Location{world=CraftWorld{name=world},x=396.9719316959381,y=59.0,z=196.7118338868022,pitch=0.0,yaw=1.4288096}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftCreeper to Location{world=CraftWorld{name=world},x=359.5,y=-39.0,z=188.5,pitch=0.0,yaw=-216.25058}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftZombie to Location{world=CraftWorld{name=world},x=311.5,y=-33.0,z=151.5,pitch=0.0,yaw=-61.99251}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftRabbit{RabbitType=WHITE} to Location{world=CraftWorld{name=world},x=439.5,y=64.0,z=77.5,pitch=0.0,yaw=100.00048}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftSpider to Location{world=CraftWorld{name=world},x=367.04761786932096,y=-9.0,z=81.00035534411637,pitch=0.0,yaw=29.89267}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftPolarBear to Location{world=CraftWorld{name=world},x=385.30000001192093,y=63.0,z=138.99650873306211,pitch=0.0,yaw=122.74106}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftSpider to Location{world=CraftWorld{name=world},x=331.80325859729817,y=2.0,z=211.60811701805764,pitch=0.0,yaw=163.68027}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftGlowSquid to Location{world=CraftWorld{name=world},x=371.48499831790105,y=18.849162741564214,z=233.3240877033677,pitch=0.0,yaw=0.4824977}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftRabbit{RabbitType=WHITE} to Location{world=CraftWorld{name=world},x=380.50741861649124,y=62.3544480140121,z=139.20000000298023,pitch=0.0,yaw=179.22757}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftBat to Location{world=CraftWorld{name=world},x=308.54768769645653,y=25.87341376651692,z=98.57801031208602,pitch=0.0,yaw=1690.7703}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftRabbit{RabbitType=WHITE} to Location{world=CraftWorld{name=world},x=212.02797420747694,y=74.0,z=358.89050697575414,pitch=0.0,yaw=149.42606}
[16:33:20 WARN]: Skipping Entity with id 
[16:33:20 INFO]: [Snapshots2] Couldn't copy entity: CraftZombie to Location{world=CraftWorld{name=world},x=428.28041226900507,y=-9.0,z=124.52208668761494,pitch=0.0,yaw=251.41702}
...

EDIT: the solution is to use EntitySnapshot instead of Entity#copy

lone oracle
#

how would I go about making a list of Locations (and then ItemStacks but I can probabyl figure that out after)?
I have ArrayList<Location> chests = new ArrayList<Location>();
But how do I add Locations to the list?

dry badge
dry badge
umbral ridge
pure dagger
#

hi, do you have to check if the meta is not null before doing methods on it?

ItemStack carrot = new ItemStack(Material.CARROT, 1);
    ItemMeta meta = carrot.getItemMeta();
umbral ridge
pure dagger
#

why do you hae to check it?

#

what if it has not meta ?

eternal oxide
#

in that instance, no. But an ItemStack is not guaranteed to have meta

#

currently only AIR has no meta

pure dagger
#

oh

umbral ridge
#

water has meta?

pure dagger
#

so do i actually have to? with my carrots

shadow night
pure dagger
#

but if it has not?

#

i create it?

#

and set it

shadow night
#

That happens automatically when you get it from an itemstack that can have a meta

worldly ingot
eternal oxide
#

Currently all ItemStacks (other than AIR) have meta, but its good practice to check as it can be null

worldly ingot
#

It just gets created automatically when getItemMeta() is called

umbral ridge
#

BARRIER has itemMeta?

worldly ingot
#

Yeah. Display name, lore, etc.

shadow night
umbral ridge
#

XD

pure dagger
#

is
!carrot.hasItemMeta()
and
getItemMeta() != null
the same?

umbral ridge
#

😿

#

getItemMeta will never be null

pure dagger
#

umm

#

then

pseudo hazel
#

what about air

umbral ridge
#

cat.hasItemMeta

#

I would use this

pure dagger
#

kinda dont get it

pseudo hazel
#

I think its less expensive

pure dagger
shadow night
#

Pretty sure has item meta isn't the same as getMeta != null

pseudo hazel
#

getItemMeta literally reconstructs the whole item each time you call it

eternal oxide
#

then its AIR or you messed up bad

shadow night
umbral ridge
#

Choco is typing

#

XD

worldly ingot
umbral ridge
#

Choco == chocolate

carmine mica
#

yes it will

pure dagger
eternal oxide
#

good programming practices

pseudo hazel
#

but why

carmine mica
#

CraftItemStack#hasItemMeta calls getItemMeta, it's creating a new meta instance

eternal oxide
#

if it can be null you check before usign it

pseudo hazel
#

why not get it, assign it to a variable

#

and then check if its null

#

if its not nmull (i.e. 99% of cases) you alreay have a variable of the meta

pure dagger
#

if it is?

warm mica
umbral ridge
#

If its Marcely99 it will be null

shadow night
#

why is this a debate

pure dagger
#

idk

#

what to do if == null?

shadow night
#

return?

pseudo hazel
#

return or smth

#

depends

umbral ridge
#

return the cat

pseudo hazel
#

like idk what your code is supposed to do

umbral ridge
#

and if not null take the cat

pseudo hazel
#

eat the cat

shadow night
late sonnet
autumn ingot
late sonnet
autumn ingot
#
public class EntityUtil {

    public static Map<EntitySnapshot, Location> copyEntities() {
        Map<EntitySnapshot, Location> entitiesMap = new HashMap<>();

        for (World world : Bukkit.getWorlds()) {
            for (Entity entity : world.getEntities()) {
                if (!(entity instanceof Player)) entitiesMap.put(entity.createSnapshot(), entity.getLocation());
            }
        }

        return entitiesMap;
    }

    public static void placeEntities(Map<EntitySnapshot, Location> entitiesMap) {
        for (int i = 0; i < 2; i++) {  // Need to run this code twice to account for any dropped items when entities are removed (e.g. minecart chests).
            for (World world : Bukkit.getWorlds()) {
                for (Entity entity : world.getEntities())
                    if (!(entity instanceof Player))
                        entity.remove();
            }
        }

        for (EntitySnapshot entitySnapshot : entitiesMap.keySet()) {
            try {
                entitySnapshot.createEntity(entitiesMap.get(entitySnapshot));
            } catch (IllegalArgumentException e) {
                Snapshots2.getInstance().getLogger().info("Couldn't copy entity: " + entitySnapshot + " to " + entitiesMap.get(entitySnapshot));
            }
        }
    }

}
#

ignore me clearing the existing entities you dont need to do that

#

but yeah just use Entity#createSnapshot and then you can do entitySnapshot.createEntity

#

its not perfect, currently im having issues with paintings because theyre not placing properly

deft locust
#

How can I add a beginner tag below the player name? I'm using spigot 1.8

pseudo hazel
#

update

#

xD

eternal oxide
#

Sharpie

low crow
#

Hi, just created a Spigot plugin project in 1.21 with jdk 21 using the Minecraft Development extension on IntelliJ and now I cant call or import the Material class even tough it's present in the external libs, (its icon is the one of the decompiled classes tho which is not normal)

eternal oxide
#

update IJ

low crow
deft locust
pseudo hazel
#

probably display entities

#

or with scoreboards

worthy yarrow
#

I actually

pseudo hazel
#

maybe thats in 1.8 too

worthy yarrow
#

I have a thing for this

#

should I spoonfeed him the modern code to do this

pseudo hazel
#

why spoonfeed

#

just dump it

#

dump and dip

worthy yarrow
#

kek

#
public void displayTitle(Player player, Title title) {
        World world = player.getWorld();
        Location location = player.getEyeLocation();
        String titleContents = ColorUtil.parsePlaceholders(player, title.getTagContents());

        TextDisplay textDisplay = world.spawn(location.clone(), TextDisplay.class);

        Vector3f offset = new Vector3f(0, 0.15f, 0);
        AxisAngle4f rotation = new AxisAngle4f();
        Vector3f scale = new Vector3f(0.75f, 0.75f, 0.75f);
        Transformation transformation = new Transformation(offset, rotation, scale, rotation);

        textDisplay.setText(titleContents);
        textDisplay.setBillboard(Display.Billboard.CENTER);
        textDisplay.setBackgroundColor(Color.fromARGB(0x80333333));
        textDisplay.setCustomNameVisible(false);
        textDisplay.setPersistent(false);
        textDisplay.setSeeThrough(false);
        textDisplay.setShadowed(false);
        textDisplay.setInvulnerable(true);

        textDisplay.setTransformation(transformation);

        this.activeTextDisplays.put(player.getUniqueId(), textDisplay);
        this.activeTitles.put(player.getUniqueId(), title);
        player.sendMessage(ChatColor.GREEN + "You have just equipped the " + ColorUtil.convertLegacyColorCodes(title.getDisplayName()) + ChatColor.GREEN + " title!");
        player.addPassenger(textDisplay);
    }```

Displays just below the player name (also I use the legacy serializer / minimessage for cooler color formatting support)
#

K bye

pseudo hazel
#

this is especially funny since there are no display entities in 1.8

worthy yarrow
#

I did say modern

pseudo hazel
#

exactly

worthy yarrow
#

You could probably do basically the same thing with armor stands tho

#

Not sure if armor stands have a transformation method tho

#

(probably not)

carmine mica
pure dagger
#

oh..

#

i actually

#

did it without the !

#

then added it

#

yea, without it

#

should be

carmine mica
#

this prints false and then true

shadow night
#

Implementation details moment

carmine mica
#

I mean its a legit issue. I think a lot of people think hasItemMeta is just a getItemMeta != null check

#

and it is not

#

the javadocs for hasItemMeta are pretty correct, but the javadocs for getItemMeta are doing no favors to the confusion

#

because it doesn't return a copy of the current defined meta, if there is no defined meta, it returns a blank meta for the stack's type

pseudo hazel
#

oof

#

might need to recheck my code now..

sterile breach
shadow night
#

The players y coordinate is always their feet

slender elbow
#

🐾

torn shuttle
#

wait, do skulls actually expose the full player texture?

eternal oxide
#

just a link

torn shuttle
eternal oxide
#

the client does

cold pawn
#

Can anyone suggest a way or give an example of how I would go about structuring a custom animation system. I want to be able to do fancy animations with Armorstands and Particles but I'm stuck with how I would be able to do it in a way were implementing new animations requires less effort than the last, any suggestions?

torn shuttle
#

smh mojang

worthy yarrow
#

You're correct

#

Again i said modern

deft locust
#

Oh ok

#

misread it then my bad

worthy yarrow
#

I'd imagine you can basically replicate that with armor stands, just dont think they have a transformation method

eternal oxide
#

But I like my cave full of rocks

wet breach
worthy yarrow
#

Ah right

#

Either way stay updated

wet breach
#

no, I generally just had my own stuff for that because relatively it isn't hard to do yourself

#

I only know of libs existing because back then I had friends mention stuff about them and what not

umbral flint
#

Is vector3f a bukkit object?

eternal oxide
#

no

worthy yarrow
#

let me go find a pic

worthy yarrow
#

oops

eternal oxide
#

spammer

worthy yarrow
#

That was supposed to be the second one lol

#

The transformation used here is to allow enough spacing for the actual player name, as well as armor and that glow cosmetic

umbral flint
#

Oh

worthy yarrow
#

Well I think

#

There's a toVector3f method

eternal oxide
#

Vector is Bukkit

#

Vector3f is many math libs

worthy yarrow
#

Ok no theres no just straight up v3f object in bukkit

#

You're right not me kek

rough drift
#

joml has Vector3f

#

embedded in Spigot

worthy yarrow
dapper flower
#

Is this a spigot bug? looks like the BlockIterator isn't working as expected dues to some internal BlockFace

[19:32:46 ERROR]: Could not pass event EntityDamageByEntityEvent to Cannons v3.0.1
java.lang.NullPointerException: Cannot invoke "org.bukkit.block.BlockFace.getOppositeFace()" because "this.mainFace" is null
        at org.bukkit.util.BlockIterator.<init>(BlockIterator.java:145) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at Cannons (5).jar/at.pavlov.cannons.utils.CannonsUtil.findSurface(CannonsUtil.java:606) ~[Cannons (5).jar:?]
        at Cannons (5).jar/at.pavlov.cannons.CreateExplosion.blockBreaker(CreateExplosion.java:163) ~[Cannons (5).jar:?]
        at Cannons (5).jar/at.pavlov.cannons.CreateExplosion.detonate(CreateExplosion.java:778) ~[Cannons (5).jar:?]
        at Cannons (5).jar/at.pavlov.cannons.CreateExplosion.directHit(CreateExplosion.java:760) ~[Cannons (5).jar:?]
        at Cannons (5).jar/at.pavlov.cannons.projectile.ProjectileManager.directHitProjectile(ProjectileManager.java:155) ~[Cannons (5).jar:?]
        at Cannons (5).jar/at.pavlov.cannons.listener.EntityListener.onProjectileHitEntity(EntityListener.java:47) ~[Cannons (5).jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor192.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:1.20.6-148-20f5165]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        
worthy yarrow
#

Doesn't mean paper / spigot aren't vastly different

kind hatch
#

Maybe one day people will learn why forks exist and realize that they aren't 100% compatible with each other.

worthy yarrow
#

🤷

kind hatch
#

Wishful thinking ig

eternal oxide
#

My 3ds game shoudl work on a PS5 as they are both consoles, right

worthy yarrow
#

100%

shadow night
#

Make it ps5 game on 3ds

#

Now that's more like paper plugin on spigot

eternal oxide
#

Running out of manhwa to read/watch. I may have to get up and do some housework 😮

river oracle
#

I feel you man

turbid flame
#

Yo i have quick question, how ItemsAdder features like custom emojis (like in fortnite) are made?

worthy yarrow
#

uh

#

What do you mean by emojis

#

Do you mean rather emotes?

kind hatch
#

Wdym like in fortnite?

worthy yarrow
#

that too kek

kind hatch
#

This is minecraft

turbid flame
#

How is this made

slate siren
#

How do we make sure that a fake death doesn't hinder the statistics..? Like kills death killstreak

   @EventHandler
    public void onPlayerDamageByPlayer(EntityDamageByEntityEvent event) {
        if (event.getEntity() instanceof Player && event.getDamager() instanceof Player) {
            Player victim = (Player) event.getEntity();
            Player killer = (Player) event.getDamager();

            // Eğer oyuncunun canı kritik seviyeye inmişse sahte ölüm gerçekleştir
            if (victim.getHealth() - event.getFinalDamage() <= 0) {
                event.setCancelled(true); // Gerçek ölümü engelle

                // Sahte ölüm işlemleri
                victim.setHealth(20.0); // Canı tamamen doldur
                victim.setGameMode(GameMode.SPECTATOR); // Spectator moduna geçir

                // Ölüm ve öldürme istatistiklerini manuel olarak artır
                victim.incrementStatistic(Statistic.DEATHS);
                killer.incrementStatistic(Statistic.PLAYER_KILLS);

                // 3 saniye sonra oyuncuyu spawn noktasına ışınla ve Survival moduna geçir
                Bukkit.getScheduler().runTaskLater(this, () -> {
                    Location spawnLocation = victim.getWorld().getSpawnLocation();
                    victim.teleport(spawnLocation);
                    victim.setGameMode(GameMode.SURVIVAL);
                }, 60L); // 3 saniye (60 tick)
            }
        }
    }

For example, a fake death like this, after the player dies, he goes into spectate mode and teleports to spawn after 3 seconds

But there is a bad side of this system, the statistics do not increase. Logically, it does not increase because it is a fake death, but it is a real death, like statistics (Kills, Death, killstreak)
How can we make it increase? I tried a few methods but they were unsuccessful.

- The reason I made such a system is to completely hide the Respawn screen```
worthy yarrow
turbid flame
worthy yarrow
#

mmm

#

I wouldn't think so, those are not native to minecraft

turbid flame
#

So which packets

pliant topaz
#

with packets/nms you're basically on ur own

worthy yarrow
#

Eh there are some here who are knowledgeable

#

I am not one of them tbf

#

I assume you'd have to animate these emotes yourself, I just have no clue how you'd actually apply them

turbid flame
#

I don't need to animate them

#

I just want to know how it's made

pliant topaz
#

seems like with a model

#

from a custom ressourcepack

#

as the player sees its body when going back to first person

worthy yarrow
#

Maybe some display entity magic

pliant topaz
#

maybe, but probably not

worthy yarrow
#

I'd think it'd be harder with display entities

pliant topaz
#

that would be way too complicated to animate, using a ressourcepack and a custom model animation that'd be the preferred way in most cases

#

i'm just not excactly sure how the players skin is displayed with the correct textures from given player

worthy yarrow
#

tbf it looks like a mod

pliant topaz
#

yeaa

worthy yarrow
#

but it does say "itemsadder" which is a plugin sooooooo

#

I'm not too sure

kind hatch
worthy yarrow
#

ewwwww shaders

kind hatch
#

Yea, I don't even know where to begin with those.
I do know that custom animations like that are done with shaders to get your player skin on those body parts.

worthy yarrow
#

When it comes to a rather large multi module project such as a hybrid skyblock / rpg core that I'm working on, I'm not too sure what should be delegated to different modules ie: base api, common, skyblock / rpg api, etc... that being said would it be suggested to try a rather reverse engineered approach and define mechanics / gameplay aspect then work on abstractions / interfacing everything out?

spare hazel
#

hey, im looking for a web panel to manage minecraft servers scattered in different machines. heres how i want it to work:

  1. install a plugin on the mc server
  2. link the server to the panel
  3. manage files, logs, tps, playercounts blah blah blah from the panel

is there anything similar to what i want?

p.s: NOT docker based

stone ruin
#

Hello, how can I check if an item is a sword ?

sterile breach
worthy yarrow
#

It's rather in the sense of this being such a large project

#

I've got my dependency tree figured, it's just onto the actual impl of these modules

rugged fern
#

How do i get nms in spigot 1.21 using maven?

worthy yarrow
sterile breach
worthy yarrow
#

Common I was saving for the more reused abstractions, whereas base api I wanted to define generic interfaces for whatever

warm mica
#

Idk if they have a webpanel though

spare hazel
warm mica
#

Yes, it's for server automation and clustering

spare hazel
#

oh cool

#

i was thinking of using pterodactyl bu this seems more reasonable

sterile breach
worthy yarrow
# worthy yarrow Common I was saving for the more reused abstractions, whereas base api I wanted ...

example:

Base api:

public interface Invite {

    UUID getInviter();
    UUID getInvitee();
    boolean isExpired();

}

Common:

public class InviteImpl implements Invite {

    private final UUID inviter;
    private final UUID invitee;
    private final Instant expiryTime;

    public InviteImpl(UUID inviter, UUID invitee, Instant expiryTime){
        this.inviter = inviter;
        this.invitee = invitee;
        this.expiryTime = expiryTime;
    }

    public UUID getInviter() {
        return inviter;
    }

    public UUID getInvitee() {
        return invitee;
    }

    public boolean isExpired() {
        return Instant.now().isAfter(expiryTime);
    }
}```
warm mica
worthy yarrow
#

Base api is simply there to hold my very generic interfaces (for the most part)

#

Whereas the skyblock / rpg api's would be where other plugin devs actually use to do whatever

#

well common is included in that as well

sterile breach
worthy yarrow
#

as defined in the tree, I just don't know how to go about actually filling in the missing pieces, such as I may define a mechanic that can be reused in either rpg / skyblock modules, this should probably be held in common right? I think my issue is that I just need to keep writing out the mechanics and what not, then decide what would be applicable to whatever module

spare hazel
kind hatch
#

Pterodactyl Panel?

spare hazel
#

no. just a simple panel for managing a single mc server (possibly a plugin) that can be used for files, logs and.....

kind hatch
#

Pterodactyl has all of that though...

#

Otherwise you're just looking at a basic server that you can ssh into

spare hazel
#

but its docker based

kind hatch
#

So?

spare hazel
#

docker prob has a team of 50 engineers brainstorming ideas on how to block access to my country even more

kind hatch
#

wut

spare hazel
#

docker is banned in my country

#

not by my country but by them

kind hatch
#

I mean, proxies do exist.
Using servers in other countries is also an option.

You are running this on a remote server right?

river oracle
#

it depends what country they're from

#

I'd imagine things would not be simple if it were somewhere like Iran

#

they work day in day out trying to make it almost impossible to access the outside web. Not to mention owning a server outside of the country is a huge no no

river oracle
#

Its unfortunate, but being resourceful is pretty much all you can do here

#

you could also try to modify pteradactyl to run outside of docker. Which I imagine wouldn't be impossible

kind hatch
river oracle
#

Seems like you can do PufferPanel with and without docker

#

seems like a pretty reasonable option given the situation

spare hazel
spare hazel
river oracle
#

this seems to be almost exactly what you'd need

#

don't thank me thank @kind hatch

#

I just started looking through the list he posted :P

spare hazel
river oracle
#

idk what happened to them I think they lost access to discord because of something

spare hazel
#

discord is unbanned... i think

river oracle
#

wasn't country related I believe

#

situational

spare hazel
#

when i asked one of my friends, he said the wanted to block the cdns but they accidentaly unblocked discord

spare hazel
#

theres a new president that made bold claims about removing sanctions and international trading and free internet and other shit

rugged fern
#

Is there any way to make these a,b,c things from nms to readable values?

kind hatch
#

Using the --remapped flag with buildtools. (On supported versions)

#

?mappings also

undone axleBOT
worthy yarrow
#

damnit

#

I was gonna do that but I wasn't sure if it was the correct link

rugged fern
kind hatch
#

Yes, --remapped supports anything above 1.17.1

#

You just need to go to the Options Tab and select Generate Remapped Jars

rugged fern
#

i've done that at the first time i generated the dependency. as far as i know i can still use maven with it right?

kind hatch
#

Yes

#

You'll just need the maven dependency

rugged fern
#

i will try it again maybe it works then? idk

rugged fern
kind hatch
#
<dependency>
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot</artifactId>
  <version>1.21-R0.1-SNAPSHOT</version>
  <classifier>remapped-mojang</classifier>
  <scope>provided</scope>
</dependency>
#

Why don't we have this as a command?

rugged fern
#

ohh so i just forgot the classifier?

kind hatch
#

Probably

rugged fern
#

hm okay now
WorldServer, EntityPlayer and stuff like this arent working any more

kind hatch
#

That's cause everything is now using Mojang names.

#

Instead of Spigot names

#

Things will be deobfuscated, but will also be named differently

#

This is where the mappings site comes in handy

#

WorldServer > ServerLevel
EntityPlayer > ServerPlayer

rugged fern
#

I see alright thanks

urban escarp
#

Hello guys, I'm here for advice. Let's say I have:
Listener a: Cancels blockBreakEvent
Listener b: Gives exp for mined blocks to unlock better blockbreakers.

It doesn't take durability from item, because event is cancelled in Listener A, but gives exp from listener B. What priority should I put on Listener a and on Listener b