#help-development
1 messages · Page 2209 of 1
Does anyone know how to keep items in the players 2*2 crafting grid?
how tf would that work
kotlin and java compile to the same thing
its not like arrays magically grow in size depending on the language
Like between hitting e? Being able to hold it as an inventory slot
Allright
Also where i can find Ziggurat library?
I have searched around all github and didnt find it
apparently the developer got banned, it was paid anyways
Yes I want items to be there in the crafting grid permanently
I can suppouse that Ziggurat was on MCM (MC-Market)?
yes
Oh
A friend just send the last version of the lib before getting banned the author
Its ilegal but me
As far i dont use it on public resources no one will matter
you might be able to play with the settings of the blank itemstacks? not sure if thats possible
def possible, i would suggest using packets since thatll cause the least pain but i saw you were having issues with that as well
or itemslots, also try kody simpson https://www.youtube.com/watch?v=WkWnq6DvWvI
Yeah, I'm using a packet but when I click this happens
https://gyazo.com/258abffe55ce1b72baf1b2331730adb4
hmm well i think this could be possible just by modifying the setslot packet going to the client, let me take a look
player.sendMessage(Utils.colorize("&9♂ Male")); results in this
if i paste in the male emoji into chat, it also pastes some weird character after it..
male horsey
how do i send an empty line in chat
||
||
can you not send a space?
i realized, not if it's trailing at the end of one string
what is this?
_ _
how do i copy that
__
type that
what i did is ||(\n)||
with a space
_ _
_ _
||
||
oo
_ _
when I sent the message there were like 50 messages not there
how is ur disc so dark
Cannot resolve method 'isInvulnerable' in 'Player'
public class GodCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (p.isInvulnerable()) {
}
}
return true;
}
}
did you import the right Player
are you using a spigot-api version that includes that method
I'm using Intellij
that in no way correlated to what i asked
you might have to cast it to entity?
it should do it automatically but it might have missed it
^
java doesnt just miss things
i dont think the method exists in 1.8
computers generally don't miss things
oh 1.8
idk that was the best error i could think of
you're prob right ab version
yeah I just checked
tanner you'll have to find a different way to check invulnerability or a different condition to check for
It doesn't
Any suggestions?
It might have actually been called god mode in 1.8
If you could tell me more about the context & purpose of this command, I can try to come up w stuff
Is this for one lang file or will it support multiple lang files?
one lang file
LanguageStorage or LanguageParser
ppl can set lang stuff themselves
ig i can provide translations on github
but one is enf
Hmmm, well I call my setup LocaleManager
It's a god command
nice ty
enables and disables god for a player
I'm checking if they're invulnerable and disabling vulnerability
It's for 1.8 though.
if they aren't invulnerable, i enable vulnerability
u gotta put invulerable players in a set
and cancel any dmaage to them
and when they run the command, check if theyre in the set
remove them
i'm just gonna dev for 1.19 and use via backwards and rewind for older players
I can use via backwards and rewind together right?
languagestorage is the way to go since they can also create placeholders to use in other parts of the plugin config so they dont need to keep typing or copy pasting
Or Zulu
got it from azul
sigh
That's a lotta .yml's
If you think that's alot, take a look at this. It's also bound to get bigger because of the languages and the data storage options.
why do you have a different config for every version :/
new items?
and its not config
clearly the actual config yamls are outside of the versioned folders
Does anyone know how to get the location of a chest when you close the chest's inventory?
Get the holder
See if it's a chest
And then get chest location?
How can i get a list of goals of a mob in nms since i want to clear it up
ping me if you can help
Get the targetselector
And you can get the goals from there
targetselector?
Yes
Use reflection
use my reflection Utils that are totally safe and aren't public
so it can completly remove the old target ai right?
Yes
ok
Are you sammu 😂
um sorry?
Nvm
He had the same question
Why are you clearing the goals tho
Jist make an enitity wifh no goals
Just*
make a class that extends the entity you want
i want to clear goal cuz i want to avoid phantom hitting the players
just want to convert phantoms to bird
thanks
by new entity you mean extending the phantom entity?
thats complicated
u dont have to do that
because then you have to define what the entity will do every tick
Yes but if it's to remove one goal just remove it with reflection
No, u just don't override the tick method
yea i guess but its a lot more complicated for just removing 1 goal
any way to add mutliple version support to a plugin?
yes
aa
@SuppressWarnings("unused")
public class v1_16_R2 extends VersionSupport {
private static final UUID chatUUID = new UUID(0L, 0L);
public v1_16_R2(Plugin plugin, String name) {
super(plugin, name);
loadDefaultEffects();
}
@Override
public void registerVersionListeners() {
new VersionCommon(this);
}```
like dis?
?verify
let me type
okay
there are two ways that you can entertain, based on how much of your codebase requires this:
-
use a
commonabstraction module with interfaces & utility classes -
then have a module for each version-range that you support & can operate
-
use an interface that outlines version-specific methods
-
implement that interface for each version/range that you support
if the versions are different because of nms, then there's the first two and:
- using
Moderocky/Glasslibrary to generate usable objects based on an interface & annotations specifying nms methods
alr
is anyone here familiar with skript? how would i turn this into java/bukkit code?
drawDragonBreath particle "flame", center player, id {_id}, arcPitch .1, arcCount 20, arcDensity 50, arcSteps 2, arcLength 6, visibleRange 30
what is the event for an item being dropped for any reason
like chest being broken
and sruff like that
dont think there is one
i should listen to block and entity ?
theres PlayerDropItemEvent, EntityDropItemEvent, BlockDropItemEvent
yea
listen to both and have them call the same method
so listening to entity and block will do for all items being dropped?
'this.targetSelector.removeGoal(NearestAttackableTargetGoal);' why it gives error?
Whats the context the code is in?
What is the error you're receiving?
Expression expected , it in in nms mob class
How do I prevent the player from losing any hunger without changing the game mode?
Java 17
API version 1.19
give him saturation 1 forever
@Override
protected void addBehaviourGoals() {
}```I am unable to override this function
why the double cast?
Hello, can I create a custom entity with custom model without using a resource pack?
you can create a custom entity class without a resource pack, but the custom model comes from the resource pack since the client only contains default models
the best you could do without resource pack is disguise the entity as a different one but that gets a bit more complex
hmm ok thanks
what is the event for hopper picking up items
bro i did as told and zombie no longer fights player but for some reason zombie is not fighting any mobs even i added the code fight pigs
Does anybody know if in MariaDB BIN_TO_UUID is implemented?
im unable to create a class that extends a horse why..?
everyone having problems here today
how do i give armor stands data?
what data?
hard to say without any error message
declaration: package: org.bukkit.entity, interface: ArmorStand
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
@Override
protected void addBehaviourGoals() {
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Player.class, false));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Pig.class, true));
}```I have ovverrided the behaviour goals so that zombie wont kill players and fight pigs instead but it works fine for player but for somereason it does not fight players
because you're overriding the same goal
@dark arrow
you are setting the 2nd goal to kill player and then resetting it to kill pig
the video only shows your IDE
oh my bad sorry
?
you are setting the 2nd goal to kill player and then resetting it to kill pig
@quaint mantle post your error here and wait for someone to help.
hi guys i keep getting this bug with a couple of my plugins in my console what does this mean- 12.06 10:25:33 [Server] Server thread/WARN Legacy plugin BetterCreeperEggs v1.9 does not specify an api-version.
does it mean the plug-in is corrupted or something
no, it just means that that plugin hasn't been updated in like 4 or 5 years and doesn't specify an api-version in its plugin.yml
yes because your name gets set to your spigotmc name
so is that a bad thing?
not really
okay cheers
but what does it actually mean
doesn’t mean like anything is wrong with them right?
wait actually i think something is wrong alex it’s doing it for all of my plugins
everyone
and they used to work fine without it
Hey Guys How Can I get Players From List
and i uploaded all the plugins to my new server and now they all getting this bug and not working properly
what list?
do you know how a list works?
alex do you know?
I think they mean the player list
you should ask in #help-server
alex this was the line before the messages about the plugins Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
okay thank you
the first goal is to kill player whch is false and it works fine
yeah but you're resetting the same goal
which is 2
you're setting the 2nd goal to not kill players and then setting it to kill pigs
set one of them to a different goal
For Example Can I get players from List<UUID> List?
ok
@Override
protected void addBehaviourGoals() {
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal(this, Player.class, false));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Pig.class, true));
}```
Bukkit#getOfflinePlayer(UUID) turns a UUID into an OfflinePlayer. If they are online, you use OfflinePlayer#getPlayer to get a player from an offline player
I wish there was a way to declare both a static and non-static method with the same name in the same class :<
nothing changed
Hey, I have problem, when I click on the result slot the event it's cancelled and it's what I want but when I hold the click and drag the item in my grey stained glass pane or my inventory, some diamond block disapear in the result slot because it's reseted to 1 diamond block (result of the recipe given), see the video if you don't understand
Thank you in advance to the one who will know how to help me
just cancel all InventoryDragEvents if your result slot is one of the affected slots
public class myEntity extends Horse {
gives error
Class 'myEntity' must either be declared abstract or implement abstract method 'getColor()' in 'Horse'
Okay thanks!
thanks
hi! my dream its to make an kitPvP server but i need help, so i am looking for someone that can help me with pluggins. i am on java and pc! dm me if you are intressed
hi im back
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
fr
i need to do that
:D
i got intelliultimate so i can do sql stuff easier now
Does anyone know how to use the metadata packet with ProtocolLib? I'm struggling how to do that, my goal is to spawn an armor stand with custom name, invisible, etc.
well
learn the api maybe
im fairly sure you can use the world#spawnParticle() method
What does that do exactly
precisely 🤷♂️
how can i get the last key of an path of an yaml file?
that seems like it would need a bit of math lol
@sweet pike atleast show us what it does ingame
theta/360 x 2 * Math.PI x dist
arc length im fairly sure
then you can calculate from the player and use a loop for the unknown
lmao
Get the section and then get the keys
buildtools
well it says
that spigot wasn't found
isnt it spigot-api not spigot
and then buildtools seperately idfk
How can I have armor for a zombie but no one sees it ?
like which packet ?
Did u run it with 1.19 and --remapped
PacketPlayOutSpawnEntityLiving
then you get the connection handle and send the packet
no no wait
handle of the player that is
i mean no one sees the armor of the zombie
PacketPlayOutEntityEquiptment
ok thanks!
Is that a normal way of using CompleteableFutures?
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player)) {
sender.sendMessage("instance");
return true;
}
Player player = (Player) sender;
if(!sender.hasPermission("cloudauth.login")) {
sender.sendMessage("perm");
return true;
}
if(args.length < 1) {
sender.sendMessage("args");
return true;
}
Main.getInstance().getDataManager().playerExists(player.getUniqueId()).whenComplete((playerExists, e) -> {
if(playerExists) {
Main.getInstance().getDataManager().getPassword(player.getUniqueId()).whenComplete((password, exc) -> {
if(password.equals(args[0])) {
sender.sendMessage("correct");
} else {
sender.sendMessage("wrong");
}
if(exc != null) {
Main.getInstance().getLogger().severe("Something went wrong while logging in for the player " + player.getName());
exc.printStackTrace();
}
});
} else {
sender.sendMessage("not registered");
}
if(e != null) {
Main.getInstance().getLogger().severe("Something went wrong while logging in for the player " + player.getName());
e.printStackTrace();
}
});
return true;
}
so you're waiting for them to login
and then running it
surely you should just listen for the login? i dont get why it's in a command
/login password
lmao
Just use authme or something bro
yea
Cryptography is something u don't wanna have to figure out
I'm asking u if that's a normal way of using CompleteableFutures
or at least encrypt it
he he he ha
fourteen brus h will know i think
he lieks completablefuture lol
can you send an actual video
it keeps downloading it
can you ss
you should check the exception in the whenComplete method, example:
someFuture.whenComplete(result, throwable) -> {
if (throwable != null) {
someLogger.log(Level.WARNING, "Failed to get a result", e);
} else {
process(result);
}
});```
looks like you're kinda doing that but the code looks weird
f
shreyas
can you explain what it does
seeing as you know skript
😬
what version
ok, ty, but is it good to use Futures like that or should I use .get() instead of .whenComplete() in this case?
you should never use get()
whencomplete i assume
as it gets the result immediately iirc
aight so theres the spigot particleapi
oh, ok, tysm
It basically shoots this firery 'cone' out of the player's mouth, and i guess from my testing, it follows the player's line of sight
why is it downloading 74mb to my pc
i cant play it through discord
ill watch it in a sec
because i accidentally record everything in 4k
Bruh just look at how skunity does it
want me to imgur it>?
ok so
thats
effectlib dragon effect
and can be created with one
like 4 lines of code
a direction vector and the dragoneffect
i'm not sure how they created that with skript
WHY IS 4 SECONDS OF VIDEO 75mB
BECAUSE I RECORD IT IN 4K
and you should be checking the exception before checking the result, cuz i assume your playerExist method is returning a CompletableFuture<Boolean> so when an exception occurred the Boolean returned with whenComplete will be null so checking if (exists) will throw a nullpointerexception cuz it calls Boolean#booleanValue internally
any tips on how to get started?
got it, thank u 💙
ask them how tf they did it in skript
if you only want to handle normal cases where no exception occurred you can use CompletableFuture#thenRun or thenAccept
ok, ty 🙂
The did it in java
drawDragonBreath is tje script command
right so
to do it in java
ill send my code rq
i have a killeffect like that
it's really simple just use an effectmanager and paly the dragon effect
hmm
effectmanager you just need to init at the plugin startup
is that on the spigot javadoc
yes
mb what library is this?
EffectLib
de.slikey
if you send me the skript i can probably recreate it in java
?paste
wtf
......
How do I get the week from the date?
yey
math
i love math
i had a trig test on friday
non calculator
7*24*60*60*1000 milliseconds
Date#getDay is deprecated, it tells to use Calender#get(Calender.WEEK_OF_YEAR)
@river spear
Using this I get week 25 even though the correct week is 23: calendar#get(calendar.WEEK_OF_YEAR)
How to open this demo window ingame?
-.-
It was gameStateChange packet iirc
What demo window?
i thought an api method was added
Not sure
declaration: package: org.bukkit.entity, interface: Player
Oo this exist
wasnt that added like last week lol
how is the best way to run something on main and then have a callback
im always using completablefutures instead of callbacks
in my opinion more useful when you actually need to store the result
i guess youre talking about async stuff
tyvm that worked ;)
minion325 bro yesterday you told me to override addBehaviur goals and so i did that and now the zombie no longer hits the player but it also does not hit the pig which i added in the target selecter
its present in 1.18 i see
hi someone help please i have an problem when set AttributeModifiers for item can someone give me an example for that pls
You're welcome :)
do zombies even attack pigs
Send ur code
Is that skDragon lmao
can I change skin of a zombie ?
resourcepack
using packets?
I managed to make it a pig, but idk about players .-. , they dont have any id
i added targetattack
@Override
protected void addBehaviourGoals() {
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Player.class, false));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, Pig.class, true));
}```
is that the original code, or decompiled?
m wondering what an Expression would be
anyone ?
skript is still hurting my brain
you can change the head i believe
i want to work with packets
people who dont know to use java 🤡
you can make zombie invisible and summon nps at that place(its kind of dumb idea)
or you can make a working npc which has zombie ai i have seen many server with that feature but its complex
in npc you can just upload a custom skin
but i dont know that we can send a packaet of npcs
some1 know how i can make a baby rabbit not grow up forever?
i dont know a method to do it forever but it can be changed to really long times like many years
actually you can set the mob age tag to negative number at a really high value and set a bukkit runnable which again sets the age tag to that number
hm
that's a really dirty solution
so?
one sec
I think Ageable has a method for that
declaration: package: org.bukkit.entity, interface: Breedable
just setAgeLock to true
sorry then 😦
if you somehow need an extremely high or extremely low value for something, in 99% of cases there's a better solution 😄 🙂
ok 🙂
just reset its age
i'm not using latest spigot ver
they still have an age
the server checks the age and if its a certain number or above it changes it to an adult
but if the age is always reset to 0
it never happens
actually you can set the mob age tag to negative number at a really high value
but i can do this right?
why dont you use setAgeLock as I told you?
Hi, i need a vector tutorial, idk how this work
you didnt say which version yo uuse
1.12.2
it might work, but Mojang fixed negative ages in 1.8 so it most likely won't
f
aaah
that will btw still work in 1.19
it's just deprecated there because now Breedable exists
oka thx
why this return 0 always?
because you're checking for reference
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
explain a little simpler
think of it as this
instance of ?
can you just listen?>
[A, B, C, D, E, F]
myreference = array[0]
assert array[0] == myreference;
they are accessing the same location in memory
you're checking that, but for the items
they are different ItemStacks, but you want to check isSimilar
@sage patio
i got it thanks
nice, thanks
feel like looping through every possible character combination?
if you can, you could try getOfflinePlayer
wait no
if you can get their uuid
you're good
getPlayer(String)
while it does return the closest player
you then just check afterwards
null check that
but yea
your issue is basically that ```java
// Players online:
// - LynxPLAYHackerMan
Bukkit.getPlayer("lynx").getName() == "LynxPLAYHackerMan"
getPlayer(String) looks through all players, filters for players whos name start with your passed name (ignoring case) and then returns the one that is closest to the string you passed
I've this code for removing a certain amount of items from player's inventory
but what should i do then player does not have that amount i need to remove?
why are you using Integer rather than int?
interesting minecraft name
don't worry, that one is made up xD
Hey, I'm trying to get into coding Plugins, however my IntelliJ is not suggesting anything! Anyone know a solution?
how did you setup your project
Step by step?
well no, generally are you using maven or gradle ?
Maven
can you share your pom.xml
?paste no bot yet?
It Lives!!
.
can someone please explain how spigot packages work and what they are?
Pom looks fine
What are you hoping it would suggest
literally anything
That's a plugin wiki
Do you see the maven tab on the right side?
yes
What class are you trying to use
Probably a better question, are you following a tutorial?
True
Deleting this link as thats not a good tutorial
yes
Which one?
So what class are you trying to access
man, i just started coding, all I know is I'm typing in my Main.java and nothings suggestingh
Yeah I didn't realize he meant java packages
Spigot Javadocs 🙃
^ yeah definitely be comfortable with java before doing this
Bukkit.
And did you import the Bukkit class
yes
I'll ask again; Do you know Java?
barely
string, wait till int pulls up, the battle will be legendary
Sounds like you might have tried to access Bukkit outside of a method and field
?learnjava Might be best to go through some of these
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Integer is one of the worst class to exist, along all other wrapper classes
Bruh
Yeah true
Valhalla when
Which valhalla will solve ^
What's that
Valhalla is a java enhancement project
Ah
One of the java enhancement proposals in there aims to avoid unnecessary boxing and unboxing, one solution to it is to allow developers to pass "primitive types" to type parameters
Myeah lynx might need to correct me here
The fact that I can allocate my optionals on stack 🥰
no
tho that isn't really the main goal

it is a nice byproduct but the main point is memory layout
Ah makes more sense actually
Project Valhalla "L-World Inline Types" Early-Access Build is available. The early access build, from Project Valhalla, aimed at testing a prototype implementation of L-World Inline Types. This build is intended for expert users interested in Project Valhalla, and is provided as a convenience so that they don't need to build from the source code...
like the benchmarks are pretty juicy
@solid sigil btw https://openjdk.java.net/jeps/8261529 in case your curiosity exceeds
especially allocation
like, damn the usability for minecraft will be sick
basically anything from Vec3d over BlockPos
BoundingBox
Aw my gifs aren't embedding today
Holy
waifu plugin
family computer
dont think your mom will code something
my dad tho
hmm it's a risk im willing to take
is skript a good alternative to making a custom plugin?
no
not in my opinion
big plugins are bassically impossible to make in skript
idk Worldedit, Land protection
that kinda stuff
i just need something that sets variables and progress markers to work with the magicspells plugin
also degrees facing variables
worldedit has math
math fun
i remember graphing things in minecraft
using the worldedit api
hehehe
i remember live graphing the coronavirus death rates
idk what i was doing
trig > algebra
trig more fun
yes
¯_(ツ)_/¯
well its not just robotic
hhehe add one to both sides
yeah tbh
starting my journey of learning java today
i've been looking at fourier transforms
wish me luck haha
idk it all seemed very complicated when. first looked at it
i guess it will get easier
its very structured
make sure to box every variable
oh this isnt general
make sure not to do that
box?
prob talking about wrapper classes
you'll learn about those
also
this isnt perfect for learning stuff in the order you need, but its a very good & clear reference for individual topics
i was joking
boxing is just unnecessary stuff like Integer.parseInt(5) or String.valueOf(somethingthatisalreadyastring)
How would I insert a class instance here? This is the code.
https://paste.md-5.net/aguzogajen.java
an instance of what class
an instance of CommonCow?
Yes
well this is your only constructor
public CommonCow(AdventureMC plugin) {
this.plugin = plugin;
}```
so new CommonCow(instanceOfYourPlugin)
Yes, and now I need to initialize CommonCow(instanceofmainclass) in the enum
uhh you'll prob have to put the enum in a class and pass plugin instance into that class
provide a Function<AdventureMC, Pet> as a parameter to the enum constructor
or that
and then you can have a
public Pet create(AdventureMC instance) {
return this.function.apply(instance);
}
only fuck up you have is enums not allowing generics
which makes the return value well
somewhat meh
there was a time i believed they could lol
the rust enums are pretty neat
you still have to construct them so they arent really constants but they can provide a different number of parameters and are generic
Now this is the constructor, what do I put in the enum fields?
Hi, why when relocating maven dependencies into the jar, it shade everything instead of just the dependencies
COMMON_COW(Utils.getHeadItem("49706", ChatColor.DARK_GRAY + "Common Cow"), "common_cow", new ???)
a lambda
CommonCow::new
:>
ninjad again
Lyn are you the one in the photo?
what photo o.O
Your profiile
are you asking if I'd would use a real picture of myself online ? 
Hmn mye
obviously that is me
yo is there a mevent for when the player lands?
lands ?
PlayerMoveEvent?
((Player) event.getRightClicked()).getPlayer().addPotionEffect(PotionEffectType.BLINDNESS.createEffect(10, 6)); ((Player) event.getRightClicked()).getPlayer().addPotionEffect(PotionEffectType.SLOW.createEffect(10, 6));
It doesn't work, why it wouldn't?
any error ?
N.
Eror?
but beyond that, that looks good
keep in mind that effect will only last .5 seconds
I even putted an if to check if the clicked entity is an instance of Player.
but how do i know when a player lands?
I tried every way, no clues.
"lands"?
falls -> then hits blocks
return function;
}```
This was a bit more advanced than I am used to haha. Can I just call the functions inside of Pet from the result of this function?
you can do public Pet getPet(AdventureMc pluginIGuess) { return function.apply(plugin) }
Should I execute the command from the console?
Thing is that I don't have a "plugin"
Like effect give ... effect
You can do:
onEvent(Bla event) {
Bukkit.distpatchCommand(player, "command")
}
Currently working on a plugin for a java & bedrock server that when you send a message it sends it to people only in the group and when I send a message it only shows it to one person:
https://prnt.sc/HvYtZ73Sfkna
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
If you wanna help me, write a simple plugin and test that lines of codes, it makes no sense, it should give back the effects . 😦
i have no clue if its a Spigot issue or if its a Geyser & Floodgate issue
how full stop
how
wtf
wdym how?
wait a damn second
does it not grant them at all ? 10 ticks is half a second
Uh, the int is referred to ticks?
Well, you got.
got
Thanks!
yes cause its a java & bedrock server which i pointed out
i see now
im not sure how well spigot code works with geyesr
Also Geyser, uses their own protocol implemention?
but it was mentioned 1.19 now has chat authentication and i have no clue if the authentication is buggy or not
since its random for who it sends the messages to so i'm really confused
I dont know much about Geyser, i just know that geyser is a plugin that allow java and bedrock connection
just pas in the adventuremc thing
Hello brothers. I have a NullPointer Error I desperatly need help with
show code
?ask
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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
So if you have a question just ask it and providing the code or error if you have
yeah thats basically it, it converts bedrock packets to java which allows bedrock users to join
Allright, but that uses another library right which implement java edition protocol?
random tag
I'm trying to open a Inventory from a public void open method. Everything seems fine in the code but it gives me a nullPointerError on the line where I try to open it
just sout everything
how do i detect when someone stops falling
thats what i do
velocity
sout?
can you show code
system dot out dot println
i don't know for that, but all i know is it worked perfectly fine in 1.18.2 but now since its 1.19 its no longer working
is there an event?
there's no event for a player falling no
I can show code
``public class KitsCommand implements CommandExecutor {
public kitselectorGUI kitselectorGUI;
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) {
Colorize.sendMessage(sender, Message.MUST_BE_PLAYER_ERROR);
} else {
Player player = (Player) sender;
if (player.hasPermission(Main.instance.getConfig().getString("permissions.kit_command"))) {
kitselectorGUI.open(player);
return true;
} else {
Colorize.sendMessage(player, Message.NO_PERMISSION_ERROR);
}
}
return true;
}
}
``
Hey so is there a way to change the colour of a glow effect without using teams?
and if so how many colours can be used?
I think its because, the protocol implementation that uses Geyser, is not already prepared for 1.19
I sent the code! :)
kotselectorgui is null
you never assign something to it
usually through the constructor
i want to kill all armor stands, but this doesnt work: /kill @e[type=armor_stand]. any ideas why?
@sterile token even 2 java players talking to each other still doesn't work:
https://prnt.sc/oKDyy2atA6y3
so it seems to be on spigot's end
I think its the protocol implementation
I cant seem to find out how to do this
I talked to the owner of Geyser, and told me that Geyser for working use their own protocol library implementation (they created one) which on 1.19 could not work because the protocol changes between diff minecraft versions
Yes, but if I do new AdventureMC(), that won't work ofc
but its not sending it to both java platforms either, so its not something to do with Geyser, its something wrong on spigot but i have no clue what
cuz it extends JavaPlugin
put in your plugin instance thro dependency injection
In an enum?
thro the method parameters
I'm sorry this might seem just braindead.. But I dont really understand how that works.. I've been stuck on this nullPointer for 2 days now and it just blocks me from developing further on the plugin. I know spoonfeeding is not the way to go but
I have a dought related to that, why some plugins that works on multiplatform (for example, bungeecord and spigot) use an Enum for loading the common things?
wasnt talking to you
What your issue?
Please use ?paste
My issue is that I have a nullPointer on when I open the inventory
ok I will
on line 20 "kitselectorGUI.open(player);"
there is a nullPointer error
KitsCommand class
NPE on line 20 of KitsCommand
give it a value
how to animate armor stand?
as I said im a beginner and dont really know how I would do that
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
^^ the guide should teach you how
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
Did you take a look?
Yes I did read it, and frankly I dont understand any of it. I dont know where I should put it, why I should put it there
and how it helps my cause
someone know how to fix the non breaking space bug please? I managed to set everything except when I do /money
best of luck then
Do you feel powerful not wanting to help someone who is new? If I dont understand the guide you sent and still need help I should just quit?
if you don't understand the basic guide here, I don't know how to help you
triggered
like, I could link you basic java tutorials ?
or spoonfeed you the solution
but neither of those probably help you
hey there, im spinning a armorstand in a repeating task. When i kill the armorstand entity, the task still continues rotating the armor stand. How can i check if the armor stand is actually still there? this is my following code:
ArmorStand armorstand = (ArmorStand) event.getBlock().getWorld().spawnEntity(event.getBlock().getLocation().add(0.5, 5, 0.5), EntityType.ARMOR_STAND);
armorstand.setHelmet(new ItemStack(Material.PLAYER_HEAD, 1));
int taskid = Bukkit.getScheduler().scheduleSyncRepeatingTask(Utils.g_plugin, new Runnable() {
int x = -360;
@Override
public void run() {
Location l = armorstand.getLocation();
System.out.println(l.getX() + " " +l.getY() + " " + l.getZ());
l.setPitch(x);
armorstand.teleport(l);
armorstand.setHeadPose(new EulerAngle( 0, Math.toRadians(x) , 0));
x+= 10;
}
},0, 3);
armorstand.getLocation always returns the location, even if the armor stand is gone
how did you learn?
i learned by making spigot plugins that were absolutely atrocious and copying code from the internet
you have to use a minimal about of brain power to convert the example in the guide to this situation
public class PlayerListener implements Listener {
private final PlayerStatsPlugin plugin;
public PlayerListener(PlayerStatsPlugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onJoin(PlayerJoinEvent event) {
event.getPlayer().sendMessage("This server uses %s :)".formatted(plugin.getName()));
}
}
is literally the same concept as the class they posted
Except I dont use listeners?
I-
yeah, but he doesn't know how to code, so he just doesn't understand what "implements" or even what having an instance method means???
you don't need to learn java first
this is HOW you learn java
you write crappy stuff first, cobbled together w/ a bunch of copy paste...
you learn java by understanding a higher level construct of dependency injection
before even knowing inheritence
the type system
Archonic maybe you could look at my code then
and that may arguably be a better way to learn
if you think so
i'd reccomend learning java before spigot tho czu it'll just get all mixed up
yeah, but we have to compromise with this guy not wanting to put the time in to learn java first
he has two options:
a. listen to you guys, get bored, quit
or b.
then he is SOL
get spoonfed, make plugins that semi-work and that he thinks are cool, and be engaged push it a little further
eventually, things will come together and he will actually be able to learn java
nullPointer on KitsCommand line 20
you should start a thread
add java public KitsCommand(kitselectorGUI kitselectorGUI) { this.kitselectorGUI = kitselectorGUI; } over the onCommand method
when you call new KitsCommand() you pass an instance of kitselectorGUI
e.g. new KitsCommand(new kitselectorGUI())
there is your spoon
eat well
good soup
Well thank you, but it still does not work. implemented the code and changed the exectutor
Now it just says nothing in the console
no error but doesnt open an inventory
Nevermind, now I get this error in the console
Well, the actions field is null
how are you filling the actions field?
Hi guys, I've one question. I guess you know CrackShot plugin, who does not, is a plugin for weapons, and in most of cases, to drop a weapon, you need to do it clicking the slot from the inventory and then dragging out from the GUI, dropping normaly with Q cancels the event. I wanna to remake this, so I wanna check if a dropped item is directly with Q key or from the inventory. My idea was to check the click type on InventoryClickEvent, and then set some variables. Is there a direct method in PlayerDropItemEvent to check this thing?
You dont know what keys press the player
The server doesnt know what key is pressing the player*
No actually, but I need to check if a drop was done with the Drop key or from the inv.
I found you need to use 3 events.
Impossible to know
Basically because of what i said right?
Yes
I didn't said I need to get the packet of the drop key.
He? What Packet
Spigot only knows an item is being dropped.
I said that I need to find how the item was dropped.
Is possible actually.
Using InventoryEvents and DropEvent.
Spigot only knows an item is being dropped. It doesn't know the cause.
When a player clicks that item in the inv. , if you add the player in a list that is being cancelled on InventoryClose, on the DropEvent you check if the drop was actually by click or using the minecraft drop key.
Pretty sure pressing Q will not trigger an InventoryClickEvent
Agree
- Yes, using the click type.
- You didn't understand what I said, maybe I was not clear, I was looking a simple way, instead of using a long one, but looking up, I found that my way is the only possible.
Hey is there a way to change the colour of the Glow Effect without using Minecrafts teams feature?
Only packets
inventory click is called before drop
grab the action, there is drop one and drop all
unlock dropping for the player with a timestamp or tick or something
and then on drop check if the player is allowed to drop the item
based again, on timestamp or whatnot
realistically, you should use server tick
Theres no Click for pressing Q though
and no InventoryOpenEvent when opening the Player Inventory
Yes, there is, there is the drog out type and the drop type.
^
The easiest way is to cancel the event in the drop event if that is the item, backing in the inv, if I drag out the cursor and I click with the cursor slot full of that item, I use the bukkit method to drop that item.
or that
but I mean, should be very doable
thx
There are two ways, Imma use the last one, if you drag out the item with the full cursor slot, but cancelling anyway the dropping event.
I just tested and pressing Q while the inventory is open does fire a click event. pressing without opening doesn;t. Just drops the current item
Yea but that is exactly what they want
It is? I thought they wanted to prevent dropping a weapon no matter what
no, just no dropping without opening the inv
so you don't accidentally drop it I guess ?
So how is he going to detect just dropping without opening inventory? No event other than teh drop fires