#help-development

1 messages · Page 1380 of 1

cinder thistle
#

since when

#

I do it all the time

lost matrix
#

Ever

cinder thistle
#

Math.pow(500, 2);

#

apparently u right idk

#

i've never had an issue with it

quaint mantle
#

@lost matrix

lost matrix
#

Math.pow(500, 2)
Wouldnt be such a difference really. But the variable name makes this clear i think.

eternal oxide
#

When she tells you "thats not 8 inches"

quaint mantle
#

why does it give me an error

lost matrix
quiet ice
#

@brave glenHandler needs to annotate a method

#

ffs

eternal oxide
#

You put teh annotation inside your onEnable

lost matrix
#

Oh i see

quaint mantle
#
package me.configz1.spawnleave;

import org.bukkit.Location;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class SpawnLeave extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {

        private static final int MAX_DISTANCE_SQ = 500 * 500;

        @EventHandler
        public void onMove(final PlayerMoveEvent event) {
            final Location worldSpawn = event.getPlayer().getWorld().getSpawnLocation();
            final Location targetLocation = event.getTo();
            if (targetLocation == null) {
                return;
            }
            if (worldSpawn.distanceSquared(event.getTo()) > MAX_DISTANCE_SQ) {
                event.setTo(worldSpawn);
            }
        }



    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
lost matrix
quaint mantle
#

oohk

sleek pond
#

lmao f5 breaks it

#

but that looks really cool

opal juniper
#

fair bit of math too i guess

bright jasper
#

have got locale system with many languages working yey

#

Locale is soon to accept player as an arg to getElement so it can get their language settings

#

or LocalPlayer for many messages

main dew
#

My computer crash and ... how I can fix this?

rain flint
#

Spigot isn't imported I think

eternal oxide
#

Could you make that screen a little smaller please

main dew
rain flint
#

Oh event.player.* is imported, weird

eternal oxide
# main dew

Its not seeing your libs. As you are not using maven I've no clue how you refresh/clean your project in Intelij

rain flint
#

even java dependencies aren't importing, 🤔

main dew
#

Maven one year I don't use Maven xD

main dew
#

oh thanks realy thanks

lost matrix
#

ffs why is there no Spigot interface for GameProfile. Im in reflection hell trying to add a simple Property in the GameProfile.

worldly ingot
#

You can PR one if you want 👀

#

Only reason we don't have one is because no one's PR'd one

lost matrix
#

I knew this was coming...

worldly ingot
#

I mean really though, it's true. If you need a feature, you can add it. We can't just know what everyone needs

lost matrix
#

Alright i think ill try making a PR again. Last time i got frustrated. But that was a while ago.

eternal night
#

but but, don't take away the joys of reflection hell 😪

lost matrix
eternal night
#

See that seems like so much fun and like such an easy usage XD

lost matrix
#

Yes. Many fun. Much wow. And type safe

eternal night
#

Yes XD can't wait for the PR tho, can hopefully learn a bit from the shortcomings of papers player profile

quaint mantle
#

hey i need to delete something from my config like jumpPad49 but it removes the thing on top like jumpPad1 not jumpPad49

eternal oxide
#

show code

quaint mantle
lost matrix
#

Regarding the contribution
So im not quite sure how to approach this. So my thought was to:

  1. Fork Bukkit and provide an interface that can be later implemented by CraftBukkit.
  2. Fork CraftBukkit then create a wrapper class that holds the GameProfile as handle.
    Im actually not sure where Spigot comes into play.
#

And how to get a spigot jar with the patches applied from the repositories

eternal night
#

Spigot patches Bukkit / Craftbukkit. You can probably just stick to modifying Bukkit and CB respectively

eternal oxide
#

You are literally checking the same value against itself every iteration

quaint mantle
#

so should i do like if (block.getX() == x && block.getY() == y && block.getZ() == z) {

eternal oxide
#

isJumpPad is never going to be true as you never set it true.

quaint mantle
#

i did?

#

it is true

#

isJumpPad = true;

eternal oxide
#

your loop just runs to the end and falls out the bottom with the last entry in c

quaint mantle
#

so how should i fix it

eternal oxide
#

well, its alwasy going to be true then, so it exits on teh very first element

#

which is why you are deletign 1 and not 49

quaint mantle
#

i dont get it how do i fix that code

eternal oxide
#

You never compare against anything in c

#

what are the contents of c?

quaint mantle
#

i se

#

i see

#

jumpPad1:
world: world
x: 178
y: 4
z: 735

eternal oxide
#

then all your tests shoudl be against c.getInt("y") etc and set c at teh begining fo the for loop

quaint mantle
#

yeah i got it i didnt notice that the x values are not being from config

#

ty

#

okey

eternal oxide
#

Move configSection = c; to right after your for loop

#

then do your 4 tests, world, x, y, z against c

river spear
quiet ice
#

Well, do you know where the cave is in the first place?

river spear
#

Yes, the cave always stays the same so I could know the location

quiet ice
#

Well, then store all the locations of the blocks in a hashset and then proceed to generate ores if a given block is exposed to one of the blocks in that hashset

river spear
#

So now I should click on each block and save that an ore is to be produced there. That is then 500-1000 entries

opaque grove
#

how do i stop that specific blocks get deytroyed by explosion

river spear
#

But how do I get the locations randomly from this hash set and so that the ores are not all in the heap so they are distributed.

quiet ice
#

Are you even generating the cave programatically @river spear ?

river spear
#

This is a built map and ores should only be generated in this cave that are visible so there are no ores behind the stones

quiet ice
#

Well then it is almost impossible to generate the ores without some large amount of work

#

If you are lucky the cave is filled with CAVE_AIR, so you could use that, but chances are you are not so lucky

river spear
#

But I don't want to produce caves, but ores

woven coral
#

https://sourceb.in/f4mSrZB0xd - what it's doing is partially correct, it's putting the name and stuff, but it sends the message more than once, depending on how many quests I have, that's because I'm doing a for each, how could I fix it?

gleaming grove
#

is it possible to give tirdent gravity for selected item?

trail oriole
#

Quick question, I got the location of an entity with getLocation()
I wanted to know how I could get this location but 3 blocks higher

#

To summon something 3 blocks higher than this entity

young knoll
#

.add(0,3,0)

trail oriole
#

GetLocation().add(0, 3, 0) ?

#

No

#

Nvm

#

I'm dumb

#

Thanks for the help

tranquil ore
#
public static ItemStack createSkull(String url, String name){
        ItemStack head = new ItemStack(Material.SKULL_ITEM);
        if(!url.isEmpty()){
            SkullMeta skullMeta = (SkullMeta) head.getItemMeta();
            skullMeta.setDisplayName(name);
            GameProfile profile = new GameProfile(UUID.randomUUID(),null);
            profile.getProperties().put("textures", new Property("textures", url));
            try{
                Field profileField = skullMeta.getClass().getDeclaredField("profile");
                profileField.setAccessible(true);
                profileField.set(skullMeta, profile);
            }catch (IllegalArgumentException|SecurityException|NoSuchFieldException|IllegalAccessException e){
                e.printStackTrace();
            }
            head.setItemMeta(skullMeta);
            return head;
        }else{
            return head;
        }
    } my code doesn't work
i want to create a plugin
that gives a player a player head
with a skin from mc heads
i found that code in the internet
but it doesn't work
it gives me heads without skins ;-;
here is my code can sb help me pls?
❤️```
young knoll
#

What are you passing into the method

tranquil ore
#

nowhere xd
i tried it in another method
but it doesn't work

young knoll
#

Doesn’t answer the question

#

What are you passing into the method

tranquil ore
#

oh
sorry
url to a skin
form mc heads

#
#

the second var is not important
it's jus an item name that i want to set

eternal oxide
#

its been up over 10 ish years, it can;t be that serious.

young knoll
#

Show us the exact URL you pass

tranquil ore
#

eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjBiMzJkMmZlODZhY2JkOWVlZjI2ZWJjOTY4ODRjNzlkOWY5ZGRiMjVkY2JkYTIzODQ3NTcxYzIwNGQyZWRiNyJ9fX0=

fathom jewel
#
private ItemStack getCustomHead(String value) {
    ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
    SkullMeta meta = (SkullMeta) head.getItemMeta();
    GameProfile profile = new GameProfile(UUID.randomUUID(), "");
    profile.getProperties().put("textures", new Property("textures", value));
    Field profileField = null;
    try {
        profileField = meta.getClass().getDeclaredField("profile");
        profileField.setAccessible(true);
        profileField.set(meta, profile);
    } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
        e.printStackTrace();
    }
    head.setItemMeta(meta);
    return head;
}```
This is what I use to get a custom head. just pass in the Value from minecraft-heads.
young knoll
tranquil sparrow
#

I made a plugin in Intellij, however when I try to load the compiled jar file to my locally hosted server it doesnt load. When someone else compiled the exact same plugin and sent me the jar file it works. Not sure whats going on here

lunar schooner
#

Hey there, quick question. I'm trying to parse a configuration file using Bukkit's YamlConfiguration. I'm using YamlConfiguration#getKeys(true), where true indicates that I want all children. However it seems that an item with children isn't being returned? See the following config snippet:

debugMode: true
listenPort: 8080
tokens:
- name: TEST
  token: ABC
  scopes:
  - READ_CONSOLE
  - SEND_COMMAND

I only get back debugMode and listenPort. Anyone got any ideas?

winter sand
#

Hi, i'm making a spigot plugin 1.16.5 with Intellij, but the IDE doesn't find net.minecraft.server, do u know why?

lunar schooner
#

You're probably importing the API

#

If you're using Gradle:

    compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
    compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT'
quiet ice
#

Try using Maven and build spigot via buildtools (DO NOT USE ANY OTHER SITES)

lunar schooner
#

the latter will also include net.minecraft.server code

#

But indeed, you MUST run build tools for your required version

quiet ice
lunar schooner
#

For Gradle, in dependencies.

quiet ice
lunar schooner
#

There are yes, but you should avoid those imo

#

I just try to steer clear of avoiding the full package in general, since it makes the plugin non version compatible. So I avoid NMS where I can and use reflection where I cant 😄

winter sand
#

for the plugin i used the "Minecraft" plugin for Intellij

lunar schooner
#

That should be fine, I think.

#

I use Eclipse myself so I cant provide any IDE specific support

quiet ice
#

Same here

winter sand
#

btw i need NMS for a custom npc

lunar schooner
#

Use ProtocolLib, or if you dont want that, use Reflection

winter sand
#

because i didn't find a tutorial for ProtocolLib

winter sand
quiet ice
#

APIs such as citizens exist for such things

winter sand
lunar schooner
#

The way you want to do it will tie you to that specific version. Since NMS imports are versioned

lunar schooner
winter sand
#

for an anti cheat

lunar schooner
glass sparrow
#

@lunar schooner I could be really wrong here, but in my testing I never get back values from deep searches so I always just iterate through when I need deep keys

lunar schooner
#

Odd, Guess the api is a bit broken there then

glass sparrow
#

Wait, what do you get back when you print the deep keys? @lunar schooner

lunar schooner
#

Everything that does not have a child

#

So from my above YAML Example I get:

[20:05:58] [Server thread/INFO]: debugMode: true
[20:05:58] [Server thread/INFO]: listenPort: 8080
#

Nothing more unfortunately

#

Wait a sec, I never deleted the old config from my plugins folder 🤦‍♂️

glass sparrow
#

oh

#

oops

lunar schooner
#

Let me try that again 😄

#

Curious how itll handle the list though

glass sparrow
#

me too

lunar schooner
#

tokens: [{name=TEST, token=ABC, scopes=[READ_CONSOLE, SEND_COMMAND]}], oh like this. That isnt very optimal

#

Might just toss out this parser and use gson

#

I need to include gson anyways, so its not much of an issue :"D

lost matrix
lunar schooner
#

Or it's me messing up lol, happens to the best of us

lost matrix
#

I get

[20:19:42 INFO]: debugMode
[20:19:42 INFO]: listenPort
[20:19:42 INFO]: tokens
glass sparrow
#

are you sure you're saving data like tokens.name = TEST etc instead of tokens = [data]

lunar schooner
#

yeah its showing up as it should, its just not very nice to work with lol

glass sparrow
#

oh alright

young knoll
lunar schooner
#

to maybe make it more easy to read, this is the same but in json:

{
  "debugMode": true,
  "listenPort": 8080,
  "tokens": [
    {
      "name": "TEST",
      "token": "ABC",
      "scopes": [
        "READ_CONSOLE",
        "SEND_COMMAND"
      ]
    }
  ]
}
winter sand
quiet ice
#

What do you use?

lunar schooner
#

Correct, You need to build it locally with BuildTools

quiet ice
#

maven or gradle?

lunar schooner
#

and you need the repository mavenLocal

winter sand
#

Could not find artifact org.spigotmcspigotpom:1.16.5-R0.1-SNAPSHOT in spigotmc-repo

#

oh no the emoji lol

winter sand
quiet ice
#

then you only need to run buildtools

quiet ice
#

?bt

queen dragonBOT
trail oriole
#

How do I cancel blocks from dropping items

#

If they break by any source

#

Not only players

winter sand
trail oriole
#

I tried that

#

Then cancel it

#

Doesn't work

lost matrix
eternal oxide
#

what "doesn't work"?

quiet ice
trail oriole
trail oriole
eternal oxide
#

destroyed by a command would require teh command to properly break it

winter sand
trail oriole
#

Yeah just giving an exemple

#

I just want blocks to stop dropping

quiet ice
#

Like nowhere, bt does it for you

eternal oxide
#

an example is no good. give us specifics

quiet ice
#

You just need to build your version of spigot and it will install it into maven local

trail oriole
#

Well I have an item shooting fireball, and it destroys the ground

#

I want the ground to not drop the items

#

But to be destroyed

sand vector
#

Can you store a 10x10x10 part of a minecraft world and put each block into a 3d array? If so would you have three for loops cycling through from bottom to top and adding each block position to the array? (Sorry for dropping g mid convo)

lost matrix
eternal oxide
#

ok, well the drop items event will not trigger for that

trail oriole
quiet ice
young knoll
#

You can remove everything from the event and then manually set it to air

#

Or change the yield to 0.0

eternal oxide
#

then listen to the explosion event

young knoll
#

Or /gamerule doTileDrops false

trail oriole
#

Frick forgot about that command

trail oriole
#

That worked

sharp bough
#

why does everyone use
Player player = (Player) sender;
when sender can be a player

#

like is there any real difference?

#

why dont we just use sender.sendMessage or sender.openInventory etc

elfin pilot
#

i use sender.sendMessage unless it needs the Player object for something

#

like location, inventory, etc

#

not sure if there is any actualy difference but i know there is no visible difference

sharp bough
#

hm yea it autofill to ((Player) sender).getLocation()

elfin pilot
#

something like sender.openInventory() would not work because CommandSender can also not be a player

sharp bough
#

yea but if i do

#
            sender.sendMessage("You can't run this command on console");
            return true;
        }```
#

before that

elfin pilot
#

that works

sharp bough
#

its always a player

elfin pilot
#

ye

#

i was about to add that as long as you do a check it should be fine

winter sand
#

Anyone know how to use PacketPlayOutRelEntityMove on 1.16.5 NMS?

sand vector
quiet ice
#

Modulo everywhere!

young knoll
#

If you check if the sender is a player first then the cast to player is fine

quiet ice
#

Warning: your CPU likes that

young knoll
#

And gives you access to a lot more methods

quiet ice
#

Just use 3 nested for loops

steel escarp
#

My commands are repeating in chat I can't figure out what's wrong

sand vector
upbeat yarrow
#

is there a comprehensive breakdown of licensure of spigot/bukkit code? like what code/binaries i can or cant include in a product or repository

young knoll
upbeat yarrow
#

lol I was going to give a more hacky method

#

if you don't have double of your jars in the plugin folder

#

just put StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); at the beginning of the command code

#

and print it out

steel escarp
elfin pilot
#

can you paste it here

young knoll
#

Gonna need a bit more info

sharp bough
#

is there a way to open an inv, allow the player to put a block in a slot and get the item meta and type of the block?

#

cant find a plugin that does that

young knoll
#

You can listen to the InventoryClick event in that inventory

elfin pilot
#

question about development ethics

#

currently in the midst of developing an RPG plugin with quests, spells, events, etc. and have gathered a small community of around 200 people interested in its progress

#

i haven't given a release date because it's a hobby project, a lot of the code has been optimized but i abused static to hell and back in some parts

elfin pilot
#

the plugin runs smoothly for the most part as of now, but in the future as it becomes more complex, it will probably show signs of its age

#

the plugin is about 15k lines

#

so the question is this

sharp bough
elfin pilot
#

ha

#

it's just an estimation

#

i searched for \n in my IDE

#

but anyway

#

do you think i should:
A) start completely from scratch using the knowledge i have compared to when i started
B) continue as normal with better practice and clean up the code in parts with each update

young knoll
#

Depends on your intentions with it

sharp bough
#

is that a general question?

young knoll
#

Private? Public? Premium?

elfin pilot
#

private, but if it gains traction i might hand it off to another developer in the future

#

or make it open source for people to tinker

sharp bough
#

i mean 15k lines of codes, you sure do know more than what you knew when you started, i think you can now make all those plugins better and more orginized

elfin pilot
#

i'll admit

#

the idea of making the entire thing again seems time consuming but exciting

sharp bough
#

but dev rule N1: If it works dont touch it

young knoll
#

I mean if it’s private it’s really up to you

#

You could run a pile of spaghetti for all the players care :p

elfin pilot
#

i guess i am trying to future proof it

sharp bough
#

how do you upload that to github tho?

young knoll
#

I mean if it’s a giant mess to maintain and expand, then you probably want to spend the time to fix that

sharp bough
#

is it 1 big file? hahaha

young knoll
#

Future you will thank you

elfin pilot
#

yeah thats what i am thinking

#

the code is organized but the main issue is old static abuse

sharp bough
#

honestly i think you should ask more experienced developers like 7smile7 and those guys

#

LMBishop

elfin pilot
#

hmm alright

young knoll
#

Sad developer noises

elfin pilot
#

[sad dev noises]

#

i mean

sharp bough
#

hahahaahaa

elfin pilot
#

a rewrite does sound fun and would be better in the long run

sharp bough
#

cries in 3 months of experience

elfin pilot
#

lol

#

ive been working on this for about three years but this is my second plugin

#

a lot of that time was used experimenting and making mistakes

#

and learning java in general

sharp bough
#
public void InvClick(InventoryClickEvent e) {
        if (e.getView().getTitle().equals("Create the custom craft")) {
            Player player = (Player) e.getWhoClicked();
            //Determine what they selected and what to do
            String meta = e.getCurrentItem().getItemMeta().getDisplayName();
            player.sendMessage(String.valueOf(meta));

            //e.setCancelled(true);

        }
    }```
any idea of why this isint running?
#
public void OpenGUI(Player player){
        Inventory inv = Bukkit.createInventory(null, 27, "Create the custom craft");

        ItemStack pane = new ItemStack(Material.BLACK_STAINED_GLASS_PANE);

        inv.setItem(3, pane);
        inv.setItem(12, pane);
        inv.setItem(21, pane);

        player.openInventory(inv);

    }```
elfin pilot
#

is there an @Override at the top

#

in your InventoryClickEvent

sharp bough
#

eventHandler

young knoll
#

Should be EventHandler

#

Is it registered

elfin pilot
#

oh whoops

#

eventhandler

sharp bough
#

yea

#

i have one

#

even when i click null i get no error

elfin pilot
#

hmm

sharp bough
#

in console

young knoll
#

Also you have a lot of NPEs waiting to happen

#

Debug the check for the title

sharp bough
young knoll
#

Also you really shouldn’t use the title to compare

elfin pilot
#

hmmm is there a better method?

#

instead of the title

young knoll
#

Use the InventoryView returned from openInventory

sharp bough
#

yea i have never seen it any other way

lucid oriole
#

Any idea why this isnt working ?
Im trying to spawn 3 boats on the client only, but it only spawns one

            for(int i = 0; i < 3; ++i){
                ((CraftPlayer) target).getHandle().playerConnection.sendPacket(new PacketPlayOutSpawnEntity(boat, 1));
            }
young knoll
#

I assume you need different numbers in the packet

#

Not sure what that int field is though

lucid oriole
#

ill try setting it to i and see what happens

#

i think thats the entity id or something cus it spawned a bunch of other stuff like fishing rods , end crystals etc

elfin pilot
#

yeah

#

it probably relates to metadata in some way

#

instead of the amount

#

i dont think there is a way to spawn multiple entities at the same time using that

young knoll
#

If it’s entity Id they need to be unique

#

For obvious reasons

elfin pilot
#

hmm

#

UUID.randomUUID()?

young knoll
#

It’s an int

elfin pilot
#

yeah

#

i was assuming that would not work

#

oh well

ornate hollow
#

Is there a player ban event?

quaint mantle
#

Yes 🙂

ornate hollow
#

What is it called?

#

I cant seem to find it

quaint mantle
#

Just add player to that list

young knoll
#

There is a kick event

ornate hollow
#

hmm i think that i can check in the quit event gives member the isBanned

#

is that a good idea?

random epoch
quaint mantle
#

Perhaps use something like e.disallow(AsyncPlayerPreLoginEvent?

#

^ that's how I do it, store banned players uuid and name check if player uuid is in list if true disallow

young knoll
#

That’s basically what vanilla does

elfin pilot
#

if they are banned it won't let them log in regardless

ornate hollow
young knoll
#

I assume you can check if they are banned in the kick event

elfin pilot
#

be careful when doing that

#

discord can ToS ban users for that sort of thing

#

though if it only mentions their MC username and not their discord account you are probably safe

#

still

#

i would tread carefully

young knoll
unreal quartz
#

discord goes down quite frequently as well btw 😛

elfin pilot
#

^

#

also

#

can someone help me tinker with serialization

dusk flicker
#

?ask

queen dragonBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

elfin pilot
#

trying to word it

#

sorry

#

so I'm trying to write a 'creature creator' mechanic for members of the content team on my server

#

there is an object called "Critter" which stores things such as its name, level, health, mana, etc

#

this Critter is paired with a reference ID of their choosing, and when a mob is spawned, it references this ID, which pulls data from the Critter object

#

here's a snippet

#
public class Critter implements Serializable {
    public final String DEFAULT_CRITTER_NAME = "Unnamed Critter";

    private String CRITTER_NAME;
    private String CRITTER_COSTUME;
    private int CRITTER_LEVEL;
    private int CRITTER_STARTING_HEALTH;
    private int CRITTER_STARTING_MAX_HEALTH;
    private int CRITTER_STARTING_MANA;
    private int CRITTER_STARTING_MAX_MANA;
    
    //example
    public Critter(String critterName) {
        CRITTER_NAME = "CritterName";
    }

    public JSONObject serialize() {
        //???
    }
    
    public Critter deserialize(/*any ideas?*/) {
        //???
    }
    
    public String getName() {return CRITTER_NAME;}
    public String getCostume() {return CRITTER_COSTUME;}
    public int getLevel() {return CRITTER_LEVEL;}
    public double getStartingHealth() {return CRITTER_STARTING_HEALTH;}
    public double getStartingMaxHealth() {return CRITTER_STARTING_MAX_HEALTH;}
    public double getStartingMana() {return CRITTER_STARTING_MANA;}
    public double getStartingMaxMana() {return CRITTER_STARTING_MAX_MANA;}
}
#

here's a rough outline

#

i was thinking of serializing it into a JSONObject for easy storage, but then i have to store the reference to a bunch of keys as well

#

i also have tried implementing Serializable but am a bit stuck

young knoll
#

Oh boy naming conventions

elfin pilot
#

heh

#

force of habit

dusk flicker
#

fix it

#

dear lord

#

it hurts

elfin pilot
#

sinful

#

how's that

dusk flicker
#

well thats better

#

but then the vars

#

lmao

#

should be camelCase without _'s

#

also you dont need to include 'CRITTER' in them as its a object class, not helpful.

#

For serialization, you need to create a JSONObject and add all the required fields like a map, and to deserialize you would have a constructor var of a JSONObject and return a new 'Critter' with all the options pulled from the JSONObject

#

I'll find one of mine for an example

elfin pilot
#

if you like, but i have experience using JSON so it shouldn't be a problem

#

was just wondering if using json would be an absolutely terrible idea or if there is a better way of serializing

dusk flicker
#

Nah thats fine

#

Thats how I do it, I use Mongo tho

elfin pilot
#

alright, thank you

#

and

#

i'll try to make my code less eyebleedy

#

thanks :>

elfin pilot
#

nice, thanks

dusk flicker
#

If you are going to be creating a lot of serializations for objects, id recommend you create an interface so its even across objects

elfin pilot
#

hmmmm

#

yeah, this will be serialized quite a bit

deft sedge
#

Is there a way for me to turn off default crafting recipes, I want to make my own custom ones but I also want to stop default game ones

young knoll
#

You can remove them with Bukkit.removeRecipe iirc

#

Might be able to remove them with a datapack too

deft sedge
#

ok, would I put that in the on startup code

fading lake
#

yeah

deft sedge
fading lake
#

if i recall correctly

deft sedge
#

o

#

k

#

is there a way to remove all of the default ones, or do i have to remove every one indifisually

deft sedge
#

pls ping me if responding

young knoll
#

Of course that may cause issues with other plugins

deft sedge
#

yea i figured it out

#

it's Bukkit.clearRecipes()

#

thx

young knoll
#

Huh didn’t know there was a single method for it

#

Interesting

deft sedge
#

yea

#

thx google

#

lol

#

I just put it in startup code

#

d

sand vector
#
HashMap<UUID,Integer>

Do hashmaps like the one above hold more than one item, So only on UUID or can it hold multiple?

young knoll
#

It can hold multiple

#

Just not duplicate keys

sand vector
#

so theoretically i could have all players stored into a hashmap?

gaunt eagle
#

mmmh, can anybody help me?

#

this main:

#

this listener

proven sierra
#

learning java could help you

gaunt eagle
#

-_-

#

Everything seems right to me.

young knoll
proven sierra
#

if you are unable to read it then everything seeming right to you means little as you clearly don't understand how the language works

young knoll
#

You called your class scoreboard

#

Maybe don't do that

gaunt eagle
#

I think I should change the name of the class.

young knoll
#

getNewScoreboard returns a bukkit scoreboard

#

But the variable is of your scoreboard type

gaunt eagle
#

Yes, I get it. Thanks ^^

#

my bad

atomic jolt
#

What do I need to learn to make my own spigot plugins

#

I want to learn how to make custom enchant plugin

young knoll
#

Java first

#

?jd

atomic jolt
#

So i should learn everything in this video?

young knoll
#

No idea how good or in depth it is

#

But you can try

atomic jolt
#

Okay thanks

upper zodiac
#

anyone know what library/classes are used to get timestamps from those 1m2d3s strings?

paper viper
#

wdym?

#

could you explain more

gaunt eagle
#

Hi again, How do I fix this ?
I think because of this, when I join in to the server, the scoreboard does not appear.

gaunt eagle
#

yeah i saw

#

But I didn't understand what to do

upper zodiac
young knoll
#

Consult the method directly below it

young knoll
#

EssentialsX does I believe

upper zodiac
#

yea they do, i jut cant find it

gaunt eagle
#

ah

#

i get it now

#

well, do i need to remove this?

young knoll
#

I mean it's not required if you do it from the method

upper zodiac
#

yep

#

im on that exact thing rn

gaunt eagle
#

@young knoll Scoreboard still does not appear when I join in to the server -_- any idea?

#

listener

young knoll
#

No @brave glenHandler above the listener

young knoll
#

I really should start escaping those

#

@EventHandler

gaunt eagle
#

Ah, I overlooked -_-

wet breach
#

@young knoll of course someone would be named event

#

XD

young knoll
#

There is also @NotNull#8197

wet breach
#

lol

trail oriole
#

Is there a way to make so that when you get it by a snowball it pushes back ?

sullen marlin
#

Give it a tiny bit of damage

gaunt eagle
#

I don't think it was a mistake. You guys can you see?

sullen marlin
#

That will be null if kirilanBlok doesn't already have an entry for the player

gaunt eagle
#

Listener:

sullen marlin
#

Change to Integer and nullcheck or use containsKey first

unreal quartz
#

if you are going to update the value right after you can use getOrDefault with the default value rather than having to do a check

gaunt eagle
#

oh int to Integer save me xD, thanks

sage dock
#

hello, how can I add my own changes to the kernel and build it through buildtools?
i tried to add changes via folder work

trail oriole
#

Is there a way to push a player upwards?

#

The only way Google proposes is with vectors and stuff

#

Broke my brain

glass sparrow
#

set a players velocity to like 2 in the y @trail oriole

trail oriole
#

Mmmh

#

I'll try

#

Thanks

sand vector
#

What is wrong with my yml file? I'm not too sure what the errors mean

drowsy helm
#

show us the yml file

sand vector
#
Mines:
A: a  #change to what you want your mine to be called. Make sure to change both values!
      1: pumpkin
          prob:    #this is the probability of how much will spawn. 0.2
      2: yellow_flower
          prob: 0.1
      3: grass
          prob: 0.15
      4: gravel
          prob: 0.2
      5: lapis_ore
          prob: 0.05
      6: stone
          prob: 0.13
      7: cobblestone
          prob: 0.12
      8: hay_block
          prob: 0.05
      9: coal_ore
          prob: 0.15
      10: iron_ore
          prob: 0.05
drowsy helm
#

indentation is off

glass sparrow
#

your prob for pumpkin is commented out so it won't have a value

drowsy helm
#

^

sand vector
#

ah, i see. Thanks

silent hound
#

is there any way to do this number?

drowsy helm
#

wot

#

do what number

silent hound
#

i mean where it shows above like tab complete but it doesn't actually complete when you tab

#

like for vanilla commands

#

like showing the syntax of the command

ivory glacier
#
@EventHandler
public void onOpenInventory(InventoryOpenEvent e) {
    openInvs.add(e.getPlayer());
}

@EventHandler
public void onCloseInventory(InventoryCloseEvent e) {
    openInvs.remove(e.getPlayer());
}```
This tracks open chests etc but not the player's own inventory?
upbeat yarrow
#

anyone know how to get a custom enchant to show up in tooltip?

#

adding it to an item work great, it glows, nbt shows that the item is enchanted

#

but if you hover over it, you wont see anything about the enchant

glass sparrow
#

is hide_enchants flag on the item @upbeat yarrow

upbeat yarrow
#

no, its a pickaxe

glass sparrow
#

probably an interferring plugin

upbeat yarrow
#

i only have my plugin active

#

it doesn't interact with items other than adding this enchant

glass sparrow
#

what enchant does it add

upbeat yarrow
#

custom enchant called spawner

#

allows picking up spawners

glass sparrow
#

how do you handle your enchant

upbeat yarrow
#

I register it like this

 public void registerEnchant() {
        try {
            Field f = Enchantment.class.getDeclaredField("acceptingNew");
            f.setAccessible(true);
            f.set(null, true);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }

        SpawnerEnchant spawnerEnchant = new SpawnerEnchant(this);
        Enchantment.registerEnchantment(spawnerEnchant);

    }```
#

then I have a command that adds the enchant to a users hand using this

ItemStack mainHandItem = toEnchant.getInventory().getItemInMainHand();
if (ToolHelper.isPickaxe(mainHandItem)) {
    mainHandItem.addEnchantment(this.plugin.SPAWNER_ENCHANT, level);
} else {
    return false;
}
quaint mantle
#

i think thats how they do it

silent hound
#

oh ok

#

thanks

#

wait how

#

i'm using fun onTabComplete

#

how do i cancel that?

quaint mantle
#

oh lord

#

are you using kotlin

silent hound
#

yeah

quaint mantle
#

😞

silent hound
#

but that doesn't matter

quaint mantle
#

event.setCancelled(true)

silent hound
#

oh

#

like a listener

#

ok

young knoll
#

The onTabComplete method does not have a setCancelled

toxic compass
#

whats is the code for create NPC

young knoll
#

PacketPlayOutAddPlayer iirc

strong tide
#

Looking for a developer for my factions server, I can pay if needed. DM me if interested

young knoll
#

?services

queen dragonBOT
sand vector
#

So im trying to set block with the material from the config file, i keep getting an error 'java.lang.String cannot be cast to org.bukkit.Material' is there any way to change a string to a material?

quaint mantle
#

Material.matchMaterial

sand vector
#

is that on the sLoc.getBlock() ?

quaint mantle
#

it's a method from Material enum

silent hound
#

ok

#

it's not working

keen quarry
#

hi, it´s me again, this time the problem than have mario091205 is from his host, he need a solution for his server to work without a problem

quaint mantle
#

Hello, why this is not working? , i'm working on PSQL ;

java.sql.SQLException: Column 'Tokens' not found.
#
      public static void createPlayer(String playername)
      {
        if (!exists(playername))
          MySQL.update("INSERT INTO PSQL (Playername, UUID, Level, XP, Tokens) VALUES ('" + playername + "', '0', '0', '0', '0')");
      }
    public static void createTable()
      {
        try
        {
          PreparedStatement ps = MySQL.getStatement("CREATE TABLE IF NOT EXISTS PSQL (Playername VARCHAR(100), UUID VARCHAR(100), Level INT(100), XP INT(100), Tokens INT(100))");
          ps.executeUpdate();
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
      
#

I WAS Putting the Tokens on the CreatingPlayer & the CreatingTable

#

then register it

#
      public static void register(Player p)
      {
        try {
            PreparedStatement ps = MySQL.getStatement("INSERT INTO PSQL (Playername, UUID, Level, XP, Tokens) VALUES (?, ?, ?, ?, ?)");
            ps.setString(1, p.getName());
            ps.setString(2, p.getUniqueId().toString());
            ps.setInt(3, 0);
            ps.setInt(4, 0);
            ps.setInt(5, 0);
            ps.executeUpdate();
            ps.close();
          }
        catch (Exception ex) {
          ex.printStackTrace();
        }
      }
#

java.sql.SQLException: Column 'Tokens' not found.

eternal night
#

i mean, CREATE TABLE IF NOT EXISTS is only creating the table if it doesn't exist yet, maybe your local database contains version of the table scheme without the Tokens column ?

#

Also there is no need for defining an int using INT(100)

#

int is 4 bytes by SQL definition

tawdry rampart
#

Is there any way to send a "BungeeCord" message from Spigot through the Spigot console? I have the code working for it to be possible by a player running a command, but trying to let console do it as well

lost matrix
eternal night
#

Concerning that BungeeCord Messages are delivered through a player's connection to the server, this might be challenging.

#

oof

#

obviously means that you cannot send any bungee cord messages if there are no players on your sever

tawdry rampart
# lost matrix You need an active Player in order to send a message via the plugin messaging ch...

Yeah, I've tried using both of these to get a random player :

Player player = Bukkit.getOnlinePlayers().stream().skip((int) (Bukkit.getOnlinePlayers().size() * Math.random())).findFirst().orElse(null);
```and 
```java
Player player = Iterables.getFirst(Bukkit.getOnlinePlayers(), null);
```then: 
```java
player.sendPluginMessage(Main.getPlugin(), "BungeeCord", b.toByteArray());
```to actually send the message

In which both give me errors in console..
lost matrix
#

You could write a little PrismarineJS application which starts with your server. This way you can have at least one connection
at all times. ^^
But at that point its probably better to think about proper communication channels.

tawdry rampart
#

Was there anything in specific that I was doing wrong with how I was getting a random player?

lost matrix
#
  public Player getRandomOnlinePlayer() {
    final Iterator<? extends Player> iterator = Bukkit.getOnlinePlayers().iterator();
    return iterator.hasNext() ? iterator.next() : null;
  }
eternal oxide
#

Why use a random player and not just the first available?

lost matrix
eternal oxide
#

ah

stone sinew
eternal oxide
#

ah thats what you did

lost matrix
eternal oxide
#

I didn't really read past random player

lost matrix
stone sinew
eternal oxide
#

It should return the players in teh order they joined the server

stone sinew
#

Exactly

lost matrix
#

But it depends where the Collection comes from.

stone sinew
#

Well if that's that case why not just use Bukkit.getOnlinePlayers().get(0)

#

Since that's what the iterator is doing.

lost matrix
stone sinew
#

Simplicity and I updated it.

lost matrix
#

But the Collection originates from a List<CraftPlayer>
So the order is maintained at least.

eternal oxide
#

There is no get method on a Collection

lost matrix
stone sinew
#

Index of then lol I'm not on my pc

tawdry rampart
# lost matrix You are trying to pass a ConsoleCommandSender where a Player is expected.

The thing I'm confused about is the only thing that actually is using Player p = (Player) sender; is something to send the player a message if there was an error, the player sending the command isn't really touched by the actual thing sending the Bungee message (at least that I know of):

public static void sendMessageToBungee(String target, String message) {
        ByteArrayOutputStream b = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(b);
        try {
            out.writeUTF("Message");
            out.writeUTF(target); // or "ALL"
            out.writeUTF(message);
        } catch (Exception e) {
            e.printStackTrace();
        }

        getRandomOnlinePlayer().sendPluginMessage(Main.getPlugin(), "BungeeCord", b.toByteArray());
    }
lost matrix
eternal oxide
lost matrix
# stone sinew Index of then lol I'm not on my pc

Or do you mean:

  public Player getRandomOnlinePlayer() {
    return Bukkit.getOnlinePlayers().toArray(Player[]::new)[0];
  }
  1. Which would be way more expensive
  2. Throw an ArrayIndexOutOfBoundsException when no player is online
lost matrix
stone sinew
tawdry rampart
dusty herald
#

check if the CommandSender is an instance of Player

#

DogKek or the opposite

lost matrix
tawdry rampart
lost matrix
quaint mantle
#

why u guys complicating it

#

@tawdry rampart

deft sedge
#

I am trying to make a command that opens a crafting table menu. I tired creating an inventory with the type crafting but it gives this error. How would I do this?

lost matrix
deft sedge
#

ohh

#

ok

#

ill try that, thanks!

quaint mantle
#

how do i portforverd bungeecord server

eternal oxide
deft sedge
lost matrix
deft sedge
#

ok

#

k so just scan thru the slots and get all the items in those slot numbers

young knoll
#

Mhm

brittle badger
#

is it possible to create a fireball with no fire?

serene blaze
#

AAA help

#

my intellisens in intellij stopped working

#

how do i get it to work so that it autocompletes minecraft related stuff?

lost matrix
serene blaze
#

im not sure

#

how do i check

lost matrix
#

Do you use maven?

serene blaze
#

i use intellij

#

oh

#

uh yeah

#

i think

lost matrix
#

Then take a look into your pom.xml

serene blaze
#

ok

#

now what

lost matrix
#

Do you have thjs dependency:

    <dependency>
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot-api</artifactId>
      <version>1.16.5-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
serene blaze
#

its for paper instead

lost matrix
#

Is it resolved?

#

(anything red means not resolved)

serene blaze
#

i dont see any red

#

oh wait

lost matrix
#

Look into Configure: Settings/Preferences | Editor | General | Code Completion
And make sure that Show suggestions as you type is enabled

serene blaze
#

now its working

#

thats weird

#

thank you

lost matrix
#

np... probably wasnt done loading

young knoll
#

Restarting fixes 99% of issues

#

Probably, give or take a few percent

lavish epoch
#

I have 2 questions...

  1. How would I spawn or automatically place water under me if I were to press a certain key?

  2. How would I be able to enable water breathing, I am getting stuck on how to check if the player was in water or not

serene blaze
#

i forgot how to build my project

young knoll
lost matrix
bright jasper
#

Does anyone have a regex which can match and get an array of all colors in a message? This includes hex colors btw, like &x&f&f&f&f&f&f

lavish epoch
young knoll
#

Yes

#

Detecting jumps isn’t a perfect system, but it can be made well enough

#

I prefer the StatisticIncrementEvent and checking for the jump stat

lavish epoch
lost matrix
young knoll
#

Just use the method

#

It handles things for you

lavish epoch
#

you mean isInWater

#

cause I don't know what to make e

young knoll
#

It’s valid for any entity

lavish epoch
#

ok

lavish epoch
lost matrix
lavish epoch
#

p as in player btw

young knoll
#

one letter variables

lavish epoch
lost matrix
#

First thing you should do is replace single letter variables with proper descriptive ones.

lavish epoch
#

ok

#

I changed the cariables

#

variables*

exotic plaza
#

How to set the eventhandler on other class?
I am a noob on plugin dev

lost matrix
bright jasper
#

what does ChatColor.getLastColors do

#

cant find much docs on it

young knoll
#

Gets the last color of a string iirc

exotic plaza
#

that means I dont want to use @ EventHandler on my main class i want to set it on other class

bright jasper
#

the issue, it prints out literally nothing

lost matrix
bright jasper
#

System.out.println(ChatColor.getLastColors(colorized) + "bruh");

#

not even the bruh

dusty herald
#

system.out.println doesn't handle ChatColors

young knoll
#

There is no color

bright jasper
#

there is a color

young knoll
#

Those are strings, I would have thought it would just print them directly

lavish epoch
#

I changed my e variable to entity cause I was assuming that was what it was... I copied this from a forum thing cause I just started working on this

lost matrix
bright jasper
#

Figured it out lmao printed through logger

#

is there a getFirstColors anywhere?

young knoll
#

You can probably create one by looking at the implementation of getLastColors

lost matrix
lavish epoch
#

`public void isInWater(isInWater entity){
Material m = entity.getPlayer().getLocation().getBlock().getType();
if (m == Material.STATIONARY_WATER || m == Material.WATER) {

          e.addPotionEffect(new PotionEffect(PotionEffectType.POISON,
                  1 , 1));
}`
#

I'll change the poison effect part

lost matrix
#

So first method parameter should be of type LivingEntity.

lavish epoch
#

ok

lavish epoch
brittle badger
lost matrix
young knoll
#

Why are you still creating your own water detection?

brittle badger
#

Is it possible to make a custom class?

lost matrix
#

What exactly are you trying to achieve?

young knoll
#

Entity#isInWater

exotic plaza
lost matrix
young knoll
#

Not sure how similar it would look

lavish epoch
#

What should I do next?

lost matrix
young knoll
brittle badger
#

There were tons of issues

young knoll
#

Cut out that, replace with entity.isInWater

lost matrix
young knoll
#

Also entity.getPlayer isn’t a thing

lavish epoch
#

its fine if you ping me

young knoll
#

net.Minecraft.server

#

The mostly obfuscated server source code

brittle badger
#

So how would I modify it?

lavish epoch
young knoll
#

I would advise avoiding that

#

Even if you make a new entity, it’ll have to render as an existing entity

brittle badger
#

Mhm, that I know

lavish epoch
#

`public void isInWater(LivingEntity entity){
entity.isInWater

          e.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING,
                  1 , 1));
}`
#

This is what I have now

young knoll
#

Correct

#

But you need to wrap it in an if statement

lavish epoch
#

Should I have the if statement wrap around the entire thing or just inside the public void part

deft sedge
#

this code kind of works, it's supposed to works if there is one item in the crafting gui, but it doesn't work if there is a stack of items, it's supposed to get te amount it also doesn't do every item in the table, but i put a continue thing in there I know i'm doing something wrong

#

?paste

queen dragonBOT
deft sedge
#

here's full code

lavish epoch
#

`public void isInWater(LivingEntity entity){
if entity.isInWater(){

          e.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING,
                  1 , 1));
      }
}`

Do you mean something like this?

young knoll
#

Mhm

young knoll
deft sedge
#

oh

#

so i can just give them the origional item

young knoll
#

Sure

bright jasper
#

anyone got a method to just get a list of every color in a string

lavish epoch
deft sedge
#

will it have the same amounts and stuff?

young knoll
#

Mhm

deft sedge
lavish epoch
young knoll
lost matrix
#

Does someone know what this is supposed to mean?
I have never heard of an Spawn Object packet. I have always spawned an ArmorStand with its raw id...

deft sedge
young knoll
#

Spawn object is a link, where does it go

lost matrix
young knoll
deft sedge
#

k thx

lost matrix
#

Which is not even a valid packet...

lavish epoch
#

`public void isInWater(LivingEntity entity){
if entity.isInWater(){

          e.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING,
                  1 , 1));
      }
}`

would this be good for the water breathing thing?

#

I'm getting a few errors off of it

young knoll
#

¯_(ツ)_/¯

deft sedge
young knoll
#

You don’t have brackets around your if statement

lavish epoch
young knoll
#

Please learn java before trying to use the spigot API

eternal oxide
lavish epoch
deft sedge
#

ok

#

thx

eternal oxide
#

its skipping items

quaint mantle
deft sedge
#

huh

deft sedge
#

oh

#

that checks if the item slot contains nothing, or air

quaint mantle
#

i made explotion plugins

young knoll
#

Uh

#

Okay

deft sedge
eternal oxide
#

yes

deft sedge
#

k

#

@eternal oxide it still didn't work 😦

eternal oxide
#

show code

deft sedge
#

k

#

?paste

queen dragonBOT
deft sedge
#

there

eternal oxide
#

Does the player see the message?

deft sedge
#

yea the debug thing works

young knoll
#

Maybe try cloning the itemstack?

#

Seems strange that doesn’t work

eternal oxide
#

I see nothing wrong with that code

young knoll
#

^

deft sedge
#

hmmmm

#

ill try the clone i guess

young knoll
#

Try adding itemStack.clone to their inv

eternal oxide
#

You could try updating the players inventory at teh very bottom.

deft sedge
#

ok

#

ill try those things

eternal oxide
#

at teh very bottom, outside the for loop

#

You also don;t need to cast event.getPlayer() to Player

deft sedge
#

ok this is really wierd

#

i tried it with different blocks, and it worked for some of them

#

i tried it with nether gold ore, and it didn't work, but with nether mycelium thing it worked

#

idk y

eternal oxide
#

You do realise when an item is added to a players inventory, if it can stack it will

deft sedge
#

yea

#

but my inv was empty

eternal oxide
#

ok

#

did you try updating?

deft sedge
#

Well now it works with the other blocks

#

wtf is going on

eternal oxide
#

as in player.updateInventory()

deft sedge
#

ummmm

#

ok

#

well it is being random

#

mbaybe player.updateinventorsidfy will work

quiet dawn
#

I have a gui that i want to have a button to have a potion bag for people what would be a good plugin to allow a player to have there own personal potion bag thats not a physical item

deft sedge
#

can't hurt

deft sedge
#

idk maybe someone can help u tho

quiet dawn
#

what server do i use then?

deft sedge
#

idk maybe not this channel

#

nvm

eternal oxide
deft sedge
#

this is the dev channel

quiet dawn
#

ok

deft sedge
#

yea what he said

quaint mantle
deft sedge
#

@eternal oxide I havent' added the update inventory thing yet, but it won't work now if i put 2 different item stacks in there, would update inventory solve this?

eternal oxide
#

No idea

deft sedge
#

i thot that that was what the continue statment did

#

that u had me delete

#

bc then it would keep looking

#

omg this thing is so touchy!

#

now its not wroking

eternal oxide
#

no, continue tells the loop to skip this iteration

deft sedge
#

imma try ur inventory update

#

ok

young knoll
#

Because yay

quaint mantle
#

Brr need to find way to get MySQL and sql compatible with same code :p

deft sedge
eternal oxide
#

show code again

deft sedge
#

k

#

?paste

queen dragonBOT
young knoll
#

I think people generally abstract sql code for this reason

deft sedge
#

for this paste

eternal oxide
#

If the player sees teh debug its running

deft sedge
#

yea

#

well i do

#

@eternal oxide I think i found the bug

#

it's the first slot

eternal oxide
#

you can remove the updateInventory() its not in a good spot anyway

#

Do you mean its only returning the first slot?

deft sedge
#

if i do this with the item, it doesn't work but after i use a different slot it makes it a 50/50 chance to work

#

idk

#

but it's that first slot that's the problem

eternal oxide
#

odd, try player.getInventory().addItem(itemStack.clone());

deft sedge
#

ok, but i think it's not getting the itme from the first slot of the crafting table inventoruy

#

ill try that

#

tho

quaint mantle
#

🤷🏻‍♂️if it works

deft sedge
#

@eternal oxide Still doesn't work for that stupid first slot

eternal oxide
#

very odd

#

oh um, one sec

deft sedge
#

ok

brittle badger
#

Currently, I'm trying to make a fireball with a head. The problem is that it is on fire. is there any way to make it not on fire?

young knoll
#

Did you try the snowball method I suggested

brittle badger
#

snowball wont work as you cant change item

brittle badger
#

ah thanks

#

can you set the size?

young knoll
#

No

deft sedge
#

@young knoll my crafting table code is being wierd, it isn't working for only the first slot of the crafting table

#

any ideas?

young knoll
#

You could try processing the first slot manually

#

With getItem(slot)

deft sedge
#

k

eternal oxide
#

I'm testign his code now

#

had to spin up a server to test on

deft sedge
#

ok

deft sedge
brittle badger
#

its way too small\

#

are there any other methods/

deft sedge
young knoll
#

So you want a big fireball

brittle badger
#

yes

#

but no fire

eternal oxide
young knoll
#

Probably nothing you can do

brittle badger
#

not even any janky stuff?

young knoll
#

If the fireball is forcibly rendered with fire by the client, probably not

eternal oxide
#

actually I have blocks duplicating. sec

brittle badger
deft sedge
#

k only difference is that u used HumanEntity

eternal oxide
#

ah I'm gettign the items back from the inventory and gettign teh one from code, as my craftign table is a real one

young knoll
#

I mean you can try setting the fire ticks to 0 every tick

deft sedge
#

yea

young knoll
#

Not exactly the most elegant solution

deft sedge
#

bc i can't use a real crafting table

eternal oxide
deft sedge
#

ok

#

well I can't use a real thign

#

and it still doesn't work for me

#

soo

#

:{

quaint mantle
#

what’s your problem?

eternal oxide
#

Show how you are creating your workbench instance

deft sedge
#

k

#

hold on

#

?paste

queen dragonBOT
deft sedge
quaint mantle
#

what’s the problem

deft sedge
#

its complicate

#

d

eternal oxide
#

ah your reference is probably going stale as its scope is lost once the command exits

deft sedge
#

ok

#

so what do i do

eternal oxide
#

sec and I'll test

deft sedge
#

k

young knoll
eternal oxide
#

yep, works here. its yoru scope

deft sedge
#

ok

#

so what do i need to do to fix?

eternal oxide
#

your gui is defined inside your command event, its reference is lost once the command exits. you need a field outside yoru method to hold your reference

deft sedge
#

ok

#

does it have to be like private Inventory gui;

young knoll
#

So when the reference is lost events behave weirdly?

deft sedge
#

bc i tried to do that and it got bad

#

nope mad

#

it got mad

young knoll
#

Because I normally only define them in local scope

eternal oxide
deft sedge
#

ok

brittle badger
#

how do i setup nms

lost matrix
brittle badger
#

well there really isnt any other solution for what im doing currently

lost matrix
eternal oxide
young knoll
#

Huh, weird

eternal oxide
#

very

young knoll
#

Never encountered that, but I normally only use click events